Produced by Araxis Merge on Thu Nov 11 22:30:37 2010 UTC. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | c:\sdks\Revit SDK 2011\Samples\FamilyCreation\CreateAirHandler\CS | Command.cs.bak | Sat Mar 27 01:53:58 2010 UTC |
2 | c:\sdks\Revit SDK 2011\Samples\FamilyCreation\CreateAirHandler\CS | Command.cs | Thu Nov 11 21:57:00 2010 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 6 | 396 |
Changed | 5 | 14 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | All differences in whitespace within lines are ignored |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | // | 1 | // | |||
2 | // (C) Cop yright 200 3-2010 by Autodesk, Inc. | 2 | // (C) Cop yright 200 3-2010 by Autodesk, Inc. | |||
3 | // | 3 | // | |||
4 | // Permiss ion to use , copy, mo dify, and distribute this soft ware in | 4 | // Permiss ion to use , copy, mo dify, and distribute this soft ware in | |||
5 | // object code form for any pu rpose and without fe e is hereb y granted, | 5 | // object code form for any pu rpose and without fe e is hereb y granted, | |||
6 | // provide d that the above cop yright not ice appear s in all c opies and | 6 | // provide d that the above cop yright not ice appear s in all c opies and | |||
7 | // that bo th that co pyright no tice and t he limited warranty and | 7 | // that bo th that co pyright no tice and t he limited warranty and | |||
8 | // restric ted rights notice be low appear in all su pporting | 8 | // restric ted rights notice be low appear in all su pporting | |||
9 | // documen tation. | 9 | // documen tation. | |||
10 | // | 10 | // | |||
11 | // AUTODES K PROVIDES THIS PROG RAM "AS IS " AND WITH ALL FAULT S. | 11 | // AUTODES K PROVIDES THIS PROG RAM "AS IS " AND WITH ALL FAULT S. | |||
12 | // AUTODES K SPECIFIC ALLY DISCL AIMS ANY I MPLIED WAR RANTY OF | 12 | // AUTODES K SPECIFIC ALLY DISCL AIMS ANY I MPLIED WAR RANTY OF | |||
13 | // MERCHAN TABILITY O R FITNESS FOR A PART ICULAR USE . AUTODESK , INC. | 13 | // MERCHAN TABILITY O R FITNESS FOR A PART ICULAR USE . AUTODESK , INC. | |||
14 | // DOES NO T WARRANT THAT THE O PERATION O F THE PROG RAM WILL B E | 14 | // DOES NO T WARRANT THAT THE O PERATION O F THE PROG RAM WILL B E | |||
15 | // UNINTER RUPTED OR ERROR FREE . | 15 | // UNINTER RUPTED OR ERROR FREE . | |||
16 | // | 16 | // | |||
17 | // Use, du plication, or disclo sure by th e U.S. Gov ernment is subject t o | 17 | // Use, du plication, or disclo sure by th e U.S. Gov ernment is subject t o | |||
18 | // restric tions set forth in F AR 52.227- 19 (Commer cial Compu ter | 18 | // restric tions set forth in F AR 52.227- 19 (Commer cial Compu ter | |||
19 | // Softwar e - Restri cted Right s) and DFA R 252.227- 7013(c)(1) (ii) | 19 | // Softwar e - Restri cted Right s) and DFA R 252.227- 7013(c)(1) (ii) | |||
20 | // (Rights in Techni cal Data a nd Compute r Software ), as appl icable. | 20 | // (Rights in Techni cal Data a nd Compute r Software ), as appl icable. | |||
21 | // | 21 | // | |||
22 | 22 | |||||
23 | 23 | |||||
24 | using Syst em; | 24 | using Syst em; | |||
25 | using Syst em.Collect ions.Gener ic; | 25 | using Syst em.Collect ions.Gener ic; | |||
26 | using Auto desk.Revit ; | 26 | using Auto desk.Revit ; | |||
27 | using Auto desk.Revit .Creation; | 27 | using Auto desk.Revit .Creation; | |||
28 | using Auto desk.Revit .DB; | 28 | using Auto desk.Revit .DB; | |||
29 | using Auto desk.Revit .UI; | 29 | using Auto desk.Revit .UI; | |||
30 | using Auto desk.Revit .DB.Mechan ical; | 30 | using Auto desk.Revit .DB.Mechan ical; | |||
31 | using Auto desk.Revit .DB.Plumbi ng; | 31 | using Auto desk.Revit .DB.Plumbi ng; | |||
32 | 32 | |||||
33 | namespace Revit.SDK. Samples.Cr eateAirHan dler.CS | 33 | namespace Revit.SDK. Samples.Cr eateAirHan dler.CS | |||
34 | { | 34 | { | |||
35 | /// <s ummary> | 35 | /// <s ummary> | |||
36 | /// Cr eate one a ir handler and add c onnectors. | 36 | /// Cr eate one a ir handler and add c onnectors. | |||
37 | /// </ summary> | 37 | /// </ summary> | |||
38 | [Autod esk.Revit. Attributes .Transacti on(Autodes k.Revit.At tributes.T ransaction Mode.Manua l)] | 38 | [Autod esk.Revit. Attributes .Transacti on(Autodes k.Revit.At tributes.T ransaction Mode.Manua l)] | |||
39 | [Autod esk.Revit. Attributes .Regenerat ion(Autode sk.Revit.A ttributes. Regenerati onOption.M anual)] | 39 | [Autod esk.Revit. Attributes .Regenerat ion(Autode sk.Revit.A ttributes. Regenerati onOption.M anual)] | |||
40 | [Autod esk.Revit. Attributes .Journalin g(Autodesk .Revit.Att ributes.Jo urnalingMo de.NoComma ndData)] | 40 | [Autod esk.Revit. Attributes .Journalin g(Autodesk .Revit.Att ributes.Jo urnalingMo de.NoComma ndData)] | |||
41 | public class Com mand : IEx ternalComm and | 41 | public class Com mand : IEx ternalComm and | |||
42 | { | 42 | { | |||
43 | // / <summary > | 43 | // / <summary > | |||
44 | // / The revi t applicat ion | 44 | // / The revi t applicat ion | |||
45 | // / </summar y> | 45 | // / </summar y> | |||
46 | pr ivate stat ic Autodes k.Revit.Ap plicationS ervices.Ap plication m_applicat ion; | 46 | pr ivate stat ic Autodes k.Revit.Ap plicationS ervices.Ap plication m_applicat ion; | |||
47 | 47 | |||||
48 | // / <summary > | 48 | // / <summary > | |||
49 | // / The curr ent docume nt of the applicatio n | 49 | // / The curr ent docume nt of the applicatio n | |||
50 | // / </summar y> | 50 | // / </summar y> | |||
51 | pr ivate stat ic Autodes k.Revit.DB .Document m_document ; | 51 | pr ivate stat ic Autodes k.Revit.DB .Document m_document ; | |||
52 | 52 | |||||
53 | // / <summary > | 53 | // / <summary > | |||
54 | // / the fact ory to cre aate extru sions and connectors | 54 | // / the fact ory to cre aate extru sions and connectors | |||
55 | // / </summar y> | 55 | // / </summar y> | |||
56 | pr ivate Fami lyItemFact ory f; | 56 | pr ivate Fami lyItemFact ory f; | |||
57 | 57 | |||||
58 | // / <summary > | 58 | // / <summary > | |||
59 | // / the extr usion arra y | 59 | // / the extr usion arra y | |||
60 | // / </summar y> | 60 | // / </summar y> | |||
61 | pr ivate Extr usion[] ex trusions; | 61 | pr ivate Extr usion[] ex trusions; | |||
62 | 62 | |||||
63 | // / <summary > | 63 | // / <summary > | |||
64 | // / The list of all th e elements to be com bined in t he air han dler syste m | 64 | // / The list of all th e elements to be com bined in t he air han dler syste m | |||
65 | // / </summar y> | 65 | // / </summar y> | |||
66 | pr ivate Comb inableElem entArray m _combineEl ements; | 66 | pr ivate Comb inableElem entArray m _combineEl ements; | |||
67 | 67 | |||||
68 | #r egion Data used to c reate extr usions and connector s | 68 | #r egion Data used to c reate extr usions and connector s | |||
69 | // / <summary > | 69 | // / <summary > | |||
70 | // / Data to create ext rusions an d connecto rs | 70 | // / Data to create ext rusions an d connecto rs | |||
71 | // / </summar y> | 71 | // / </summar y> | |||
72 | pr ivate Auto desk.Revit .DB.XYZ [, ] profileD ata = new Autodesk.R evit.DB.XY Z [5, 4] | 72 | pr ivate Auto desk.Revit .DB.XYZ [, ] profileD ata = new Autodesk.R evit.DB.XY Z [5, 4] | |||
73 | { | 73 | { | |||
74 | // In Ar ray 0 to 2 , the data is the po ints that defines th e edges of the profi le | 74 | // In Ar ray 0 to 2 , the data is the po ints that defines th e edges of the profi le | |||
75 | { | 75 | { | |||
76 | new Autodesk.R evit.DB.XY Z (-17.28, -0.53, 0. 9), | 76 | new Autodesk.R evit.DB.XY Z (-17.28, -0.53, 0. 9), | |||
77 | new Autodesk.R evit.DB.XY Z (-17.28, 11, 0.9), | 77 | new Autodesk.R evit.DB.XY Z (-17.28, 11, 0.9), | |||
78 | new Autodesk.R evit.DB.XY Z (-0.57, 11, 0.9), | 78 | new Autodesk.R evit.DB.XY Z (-0.57, 11, 0.9), | |||
79 | new Autodesk.R evit.DB.XY Z (-0.57, -0.53, 0.9 ) | 79 | new Autodesk.R evit.DB.XY Z (-0.57, -0.53, 0.9 ) | |||
80 | }, | 80 | }, | |||
81 | { | 81 | { | |||
82 | new Autodesk.R evit.DB.XY Z (-0.57, 7, 6.58), | 82 | new Autodesk.R evit.DB.XY Z (-0.57, 7, 6.58), | |||
83 | new Autodesk.R evit.DB.XY Z (-0.57, 7, 3), | 83 | new Autodesk.R evit.DB.XY Z (-0.57, 7, 3), | |||
84 | new Autodesk.R evit.DB.XY Z (-0.57, 3.6, 3), | 84 | new Autodesk.R evit.DB.XY Z (-0.57, 3.6, 3), | |||
85 | new Autodesk.R evit.DB.XY Z (-0.57, 3.6, 6.58) | 85 | new Autodesk.R evit.DB.XY Z (-0.57, 3.6, 6.58) | |||
86 | }, | 86 | }, | |||
87 | { | 87 | { | |||
88 | new Autodesk.R evit.DB.XY Z (-17.28, -0.073, 7 .17), | 88 | new Autodesk.R evit.DB.XY Z (-17.28, -0.073, 7 .17), | |||
89 | new Autodesk.R evit.DB.XY Z (-17.28, 10.76, 7. 17), | 89 | new Autodesk.R evit.DB.XY Z (-17.28, 10.76, 7. 17), | |||
90 | new Autodesk.R evit.DB.XY Z (-17.28, 10.76, 3. 58), | 90 | new Autodesk.R evit.DB.XY Z (-17.28, 10.76, 3. 58), | |||
91 | new Autodesk.R evit.DB.XY Z (-17.28, -0.073, 3 .58) | 91 | new Autodesk.R evit.DB.XY Z (-17.28, -0.073, 3 .58) | |||
92 | }, | 92 | }, | |||
93 | // In Ar ray 3 and 4, the dat a is the n ormal and origin of the plane of the arc profile | 93 | // In Ar ray 3 and 4, the dat a is the n ormal and origin of the plane of the arc profile | |||
94 | { | 94 | { | |||
95 | new Autodesk.R evit.DB.XY Z (0, -1, 0), | 95 | new Autodesk.R evit.DB.XY Z (0, -1, 0), | |||
96 | new Autodesk.R evit.DB.XY Z (-9, 0.5 3, 7.17), | 96 | new Autodesk.R evit.DB.XY Z (-9, 0.5 3, 7.17), | |||
97 | null , | 97 | null , | |||
98 | null | 98 | null | |||
99 | }, | 99 | }, | |||
100 | { | 100 | { | |||
101 | new Autodesk.R evit.DB.XY Z (0, -1, 0), | 101 | new Autodesk.R evit.DB.XY Z (0, -1, 0), | |||
102 | new Autodesk.R evit.DB.XY Z (-8.24, 0.53, 0.67 ), | 102 | new Autodesk.R evit.DB.XY Z (-8.24, 0.53, 0.67 ), | |||
103 | null , | 103 | null , | |||
104 | null | 104 | null | |||
105 | } | 105 | } | |||
106 | }; | 106 | }; | |||
107 | 107 | |||||
108 | // / <summary > | 108 | // / <summary > | |||
109 | // / the norm al and ori gin of the sketch pl ane | 109 | // / the norm al and ori gin of the sketch pl ane | |||
110 | // / </summar y> | 110 | // / </summar y> | |||
111 | pr ivate Auto desk.Revit .DB.XYZ [, ] sketchPl aneData = new Autode sk.Revit.D B.XYZ [5, 2] | 111 | pr ivate Auto desk.Revit .DB.XYZ [, ] sketchPl aneData = new Autode sk.Revit.D B.XYZ [5, 2] | |||
112 | { | 112 | { | |||
113 | {new Autodesk.R evit.DB.XY Z (0, 0, - 1), new Autodesk.R evit.DB.XY Z (0, 0, 0.9)}, | 113 |
{new
Autodesk.R
evit.DB.XY
Z
(0,
0,
|
|||
114 | {new Aut odesk.Revi t.DB.XYZ ( 1, 0, 0), new Autode sk.Revit.D B.XYZ (-0. 57, 0, 0)} , | 114 | {new Aut odesk.Revi t.DB.XYZ ( 1, 0, 0), new Autode sk.Revit.D B.XYZ (-0. 57, 0, 0)} , | |||
115 |
{new
Autodesk.R
evit.DB.XY
Z
(
|
115 | {new Autodesk.R evit.DB.XY Z ( - 1, 0, 0), new Autodesk.R evit.DB.XY Z (-17.28, 0, 0)}, | |||
116 | {new Aut odesk.Revi t.DB.XYZ ( 0, -1, 0), new Autod esk.Revit. DB.XYZ (0, 0.53, 0)} , | 116 | {new Aut odesk.Revi t.DB.XYZ ( 0, -1, 0), new Autod esk.Revit. DB.XYZ (0, 0.53, 0)} , | |||
117 | {new Aut odesk.Revi t.DB.XYZ ( 0, -1, 0), new Autod esk.Revit. DB.XYZ (0, 0.53, 0)} | 117 | {new Aut odesk.Revi t.DB.XYZ ( 0, -1, 0), new Autod esk.Revit. DB.XYZ (0, 0.53, 0)} | |||
118 | }; | 118 | }; | |||
119 | 119 | |||||
120 | // / <summary > | 120 | // / <summary > | |||
121 | // / the star t and end offsets of the extru sion | 121 | // / the star t and end offsets of the extru sion | |||
122 | // / </summar y> | 122 | // / </summar y> | |||
123 | pr ivate doub le[,] extr usionOffse ts = new d ouble[5, 2 ] | 123 | pr ivate doub le[,] extr usionOffse ts = new d ouble[5, 2 ] | |||
124 | { | 124 | { | |||
125 | {-0.9, 6 .77}, | 125 | {-0.9, 6 .77}, | |||
126 |
{0,
|
126 | {0, - 0.18}, | |||
127 |
{0,
|
127 | {0, - 0.08}, | |||
128 | {1, 1.15 }, | 128 | {1, 1.15 }, | |||
129 | {1, 1.15 } | 129 | {1, 1.15 } | |||
130 | }; | 130 | }; | |||
131 | 131 | |||||
132 | // / <summary > | 132 | // / <summary > | |||
133 | // / whether the extrus ion is sol id | 133 | // / whether the extrus ion is sol id | |||
134 | // / </summar y> | 134 | // / </summar y> | |||
135 | pr ivate bool [] isSolid = new boo l[5] { tru e, false, false, tru e, true }; | 135 | pr ivate bool [] isSolid = new boo l[5] { tru e, false, false, tru e, true }; | |||
136 | 136 | |||||
137 | // / <summary > | 137 | // / <summary > | |||
138 | // / the radi us of the arc profil e | 138 | // / the radi us of the arc profil e | |||
139 | // / </summar y> | 139 | // / </summar y> | |||
140 | pr ivate doub le arcRadi us = 0.17; | 140 | pr ivate doub le arcRadi us = 0.17; | |||
141 | 141 | |||||
142 | // / <summary > | 142 | // / <summary > | |||
143 | // / the heig ht and wid th of the connector | 143 | // / the heig ht and wid th of the connector | |||
144 | // / </summar y> | 144 | // / </summar y> | |||
145 | pr ivate doub le[,] conn ectorDimen sions = ne w double[2 , 2] | 145 | pr ivate doub le[,] conn ectorDimen sions = ne w double[2 , 2] | |||
146 | { | 146 | { | |||
147 |
{3.5
|
147 | {3.5 8 , 3. 4 }, | |||
148 |
{3.5
8
,
10.83
|
148 | {3.5 9 , 10.83 3 } | |||
149 | }; | 149 | }; | |||
150 | 150 | |||||
151 | // / <summary > | 151 | // / <summary > | |||
152 | // / the flow of the co nnector | 152 | // / the flow of the co nnector | |||
153 | // / </summar y> | 153 | // / </summar y> | |||
154 | pr ivate doub le flow = 547; | 154 | pr ivate doub le flow = 547; | |||
155 | 155 | |||||
156 | // / <summary > | 156 | // / <summary > | |||
157 | // / Transact ion of Ext ernalComma nd | 157 | // / Transact ion of Ext ernalComma nd | |||
158 | // / </summar y> | 158 | // / </summar y> | |||
159 | pr ivate Tran saction m_ transactio n; | 159 | pr ivate Tran saction m_ transactio n; | |||
160 | #e ndregion | 160 | #e ndregion | |||
161 | 161 | |||||
162 | #r egion IExt ernalComma nd Members | 162 | #r egion IExt ernalComma nd Members | |||
163 | // / <summary > | 163 | // / <summary > | |||
164 | // / Implemen t this met hod as an external c ommand for Revit. | 164 | // / Implemen t this met hod as an external c ommand for Revit. | |||
165 | // / </summar y> | 165 | // / </summar y> | |||
166 | // / <param n ame="comma ndData">An object th at is pass ed to the external a pplication | 166 | // / <param n ame="comma ndData">An object th at is pass ed to the external a pplication | |||
167 | // / which co ntains dat a related to the com mand, | 167 | // / which co ntains dat a related to the com mand, | |||
168 | // / such as the applic ation obje ct and act ive view.< /param> | 168 | // / such as the applic ation obje ct and act ive view.< /param> | |||
169 | // / <param n ame="messa ge">A mess age that c an be set by the ext ernal appl ication | 169 | // / <param n ame="messa ge">A mess age that c an be set by the ext ernal appl ication | |||
170 | // / which wi ll be disp layed if a failure o r cancella tion is re turned by | 170 | // / which wi ll be disp layed if a failure o r cancella tion is re turned by | |||
171 | // / the exte rnal comma nd.</param > | 171 | // / the exte rnal comma nd.</param > | |||
172 | // / <param n ame="eleme nts">A set of elemen ts to whic h the exte rnal appli cation | 172 | // / <param n ame="eleme nts">A set of elemen ts to whic h the exte rnal appli cation | |||
173 | // / can add elements t hat are to be highli ghted in c ase of fai lure or ca ncellation .</param> | 173 | // / can add elements t hat are to be highli ghted in c ase of fai lure or ca ncellation .</param> | |||
174 | // / <returns >Return th e status o f the exte rnal comma nd. | 174 | // / <returns >Return th e status o f the exte rnal comma nd. | |||
175 | // / A result of Succee ded means that the A PI externa l method f unctioned as expecte d. | 175 | // / A result of Succee ded means that the A PI externa l method f unctioned as expecte d. | |||
176 | // / Cancelle d can be u sed to sig nify that the user c ancelled t he externa l operatio n | 176 | // / Cancelle d can be u sed to sig nify that the user c ancelled t he externa l operatio n | |||
177 | // / at some point. Fai lure shoul d be retur ned if the applicati on is unab le to proc eed with | 177 | // / at some point. Fai lure shoul d be retur ned if the applicati on is unab le to proc eed with | |||
178 | // / the oper ation.</re turns> | 178 | // / the oper ation.</re turns> | |||
179 | pu blic Autod esk.Revit. UI.Result Execute(Ex ternalComm andData co mmandData, ref strin g message, | 179 | pu blic Autod esk.Revit. UI.Result Execute(Ex ternalComm andData co mmandData, ref strin g message, | |||
180 | ElementS et element s) | 180 | ElementS et element s) | |||
181 | { | 181 | { | |||
182 | // set o ut default result to failure. | 182 | // set o ut default result to failure. | |||
183 | Autodesk .Revit.UI. Result ret Res = Auto desk.Revit .UI.Result .Failed; | 183 | Autodesk .Revit.UI. Result ret Res = Auto desk.Revit .UI.Result .Failed; | |||
184 | m_applic ation = co mmandData. Applicatio n.Applicat ion; | 184 | m_applic ation = co mmandData. Applicatio n.Applicat ion; | |||
185 | m_docume nt = comma ndData.App lication.A ctiveUIDoc ument.Docu ment; | 185 | m_docume nt = comma ndData.App lication.A ctiveUIDoc ument.Docu ment; | |||
186 | f = m_do cument.Fam ilyCreate; | 186 | f = m_do cument.Fam ilyCreate; | |||
187 | extrusio ns = new E xtrusion[5 ]; | 187 | extrusio ns = new E xtrusion[5 ]; | |||
188 | m_combin eElements = new Comb inableElem entArray() ; | 188 | m_combin eElements = new Comb inableElem entArray() ; | |||
189 | 189 | |||||
190 | m_transa ction = ne w Transact ion(m_docu ment, "Ext ernal Tool "); | 190 | m_transa ction = ne w Transact ion(m_docu ment, "Ext ernal Tool "); | |||
191 | m_transa ction.Star t(); | 191 | m_transa ction.Star t(); | |||
192 | 192 | |||||
193 | if (m_do cument.Own erFamily.F amilyCateg ory.Name ! = "Mechani cal Equipm ent") | 193 | if (m_do cument.Own erFamily.F amilyCateg ory.Name ! = "Mechani cal Equipm ent") | |||
194 | { | 194 | { | |||
195 | mess age = "Ple ase make s ure you op ened a tem plate of M echanical Equipment. "; | 195 | mess age = "Ple ase make s ure you op ened a tem plate of M echanical Equipment. "; | |||
196 | retu rn retRes; | 196 | retu rn retRes; | |||
197 | } | 197 | } | |||
198 | 198 | |||||
199 | try | 199 | try | |||
200 | { | 200 | { | |||
201 | Crea teExtrusio ns(); | 201 | Crea teExtrusio ns(); | |||
202 | m_do cument.Reg enerate(); | 202 | m_do cument.Reg enerate(); | |||
203 | Crea teConnecto rs(); | 203 | Crea teConnecto rs(); | |||
204 | m_do cument.Reg enerate(); | 204 | m_do cument.Reg enerate(); | |||
205 | m_do cument.Com bineElemen ts(m_combi neElements ); | 205 | m_do cument.Com bineElemen ts(m_combi neElements ); | |||
206 | m_do cument.Reg enerate(); | 206 | m_do cument.Reg enerate(); | |||
207 | } | 207 | } | |||
208 | catch(Ex ception x) | 208 | catch(Ex ception x) | |||
209 | { | 209 | { | |||
210 | m_tr ansaction. RollBack() ; | 210 | m_tr ansaction. RollBack() ; | |||
211 | mess age = x.Me ssage; | 211 | mess age = x.Me ssage; | |||
212 | retu rn retRes; | 212 | retu rn retRes; | |||
213 | } | 213 | } | |||
214 | 214 | |||||
215 | m_transa ction.Comm it(); | 215 | m_transa ction.Comm it(); | |||
216 | 216 | |||||
217 | retRes = Autodesk. Revit.UI.R esult.Succ eeded; | 217 | retRes = Autodesk. Revit.UI.R esult.Succ eeded; | |||
218 | return r etRes; | 218 | return r etRes; | |||
219 | } | 219 | } | |||
220 | #e ndregion | 220 | #e ndregion | |||
221 | 221 | |||||
222 | // / <summary > | 222 | // / <summary > | |||
223 | // / get all planar fac es of an e xtrusion | 223 | // / get all planar fac es of an e xtrusion | |||
224 | // / </summar y> | 224 | // / </summar y> | |||
225 | // / <param n ame="extru sion">the extrusion to read</p aram> | 225 | // / <param n ame="extru sion">the extrusion to read</p aram> | |||
226 | // / <returns >a list of all plana r faces of the extru sion</retu rns> | 226 | // / <returns >a list of all plana r faces of the extru sion</retu rns> | |||
227 | pu blic List< PlanarFace > GetPlana rFaces(Ext rusion ext rusion) | 227 | pu blic List< PlanarFace > GetPlana rFaces(Ext rusion ext rusion) | |||
228 | { | 228 | { | |||
229 | // the o ption to g et geometr y elements | 229 | // the o ption to g et geometr y elements | |||
230 | Options m_geoOptio ns = m_app lication.C reate.NewG eometryOpt ions(); | 230 | Options m_geoOptio ns = m_app lication.C reate.NewG eometryOpt ions(); | |||
231 | m_geoOpt ions.View = m_docume nt.ActiveV iew; | 231 | m_geoOpt ions.View = m_docume nt.ActiveV iew; | |||
232 | m_geoOpt ions.Compu teReferenc es = true; | 232 | m_geoOpt ions.Compu teReferenc es = true; | |||
233 | 233 | |||||
234 | // get t he planar faces | 234 | // get t he planar faces | |||
235 | List<Pla narFace> m _planarFac es = new L ist<Planar Face>(); | 235 | List<Pla narFace> m _planarFac es = new L ist<Planar Face>(); | |||
236 | Autodesk .Revit.DB. GeometryEl ement geoE lement = e xtrusion.g et_Geometr y(m_geoOpt ions); | 236 | Autodesk .Revit.DB. GeometryEl ement geoE lement = e xtrusion.g et_Geometr y(m_geoOpt ions); | |||
237 | foreach (GeometryO bject geoO bject in g eoElement. Objects) | 237 | foreach (GeometryO bject geoO bject in g eoElement. Objects) | |||
238 | { | 238 | { | |||
239 | Soli d geoSolid = geoObje ct as Soli d; | 239 | Soli d geoSolid = geoObje ct as Soli d; | |||
240 | if ( null == ge oSolid) | 240 | if ( null == ge oSolid) | |||
241 | { | 241 | { | |||
242 | continue; | 242 | continue; | |||
243 | } | 243 | } | |||
244 | fore ach (Face geoFace in geoSolid. Faces) | 244 | fore ach (Face geoFace in geoSolid. Faces) | |||
245 | { | 245 | { | |||
246 | if (geoFac e is Plana rFace) | 246 | if (geoFac e is Plana rFace) | |||
247 | { | 247 | { | |||
248 | m_plan arFaces.Ad d(geoFace as PlanarF ace); | 248 | m_plan arFaces.Ad d(geoFace as PlanarF ace); | |||
249 | } | 249 | } | |||
250 | } | 250 | } | |||
251 | } | 251 | } | |||
252 | return m _planarFac es; | 252 | return m _planarFac es; | |||
253 | } | 253 | } | |||
254 | 254 | |||||
255 | // / <summary > | 255 | // / <summary > | |||
256 | // / create t he extrusi ons of the air handl er system | 256 | // / create t he extrusi ons of the air handl er system | |||
257 | // / </summar y> | 257 | // / </summar y> | |||
258 | pr ivate void CreateExt rusions() | 258 | pr ivate void CreateExt rusions() | |||
259 | { | 259 | { | |||
260 | Autodesk .Revit.Cre ation.Appl ication ap p = m_appl ication.Cr eate; | 260 | Autodesk .Revit.Cre ation.Appl ication ap p = m_appl ication.Cr eate; | |||
261 | CurveArr ay curves = null; | 261 | CurveArr ay curves = null; | |||
262 | CurveArr Array prof ile = null ; | 262 | CurveArr Array prof ile = null ; | |||
263 | Plane pl ane = null ; | 263 | Plane pl ane = null ; | |||
264 | SketchPl ane sketch Plane = nu ll; | 264 | SketchPl ane sketch Plane = nu ll; | |||
265 | 265 | |||||
266 | #region Create the cuboid ex trusions | 266 | #region Create the cuboid ex trusions | |||
267 | 267 | |||||
268 | for (int i = 0; i <= 2; ++i) | 268 | for (int i = 0; i <= 2; ++i) | |||
269 | { | 269 | { | |||
270 | // c reate the profile | 270 | // c reate the profile | |||
271 | curv es = app.N ewCurveArr ay(); | 271 | curv es = app.N ewCurveArr ay(); | |||
272 | curv es.Append( app.NewLin e(profileD ata[i, 0], profileDa ta[i, 1], true)); | 272 | curv es.Append( app.NewLin e(profileD ata[i, 0], profileDa ta[i, 1], true)); | |||
273 | curv es.Append( app.NewLin e(profileD ata[i, 1], profileDa ta[i, 2], true)); | 273 | curv es.Append( app.NewLin e(profileD ata[i, 1], profileDa ta[i, 2], true)); | |||
274 | curv es.Append( app.NewLin e(profileD ata[i, 2], profileDa ta[i, 3], true)); | 274 | curv es.Append( app.NewLin e(profileD ata[i, 2], profileDa ta[i, 3], true)); | |||
275 | curv es.Append( app.NewLin e(profileD ata[i, 3], profileDa ta[i, 0], true)); | 275 | curv es.Append( app.NewLin e(profileD ata[i, 3], profileDa ta[i, 0], true)); | |||
276 | prof ile = app. NewCurveAr rArray(); | 276 | prof ile = app. NewCurveAr rArray(); | |||
277 | prof ile.Append (curves); | 277 | prof ile.Append (curves); | |||
278 | 278 | |||||
279 | // c reate the sketch pla ne | 279 | // c reate the sketch pla ne | |||
280 | plan e = app.Ne wPlane(ske tchPlaneDa ta[i, 0], sketchPlan eData[i, 1 ]); | 280 | plan e = app.Ne wPlane(ske tchPlaneDa ta[i, 0], sketchPlan eData[i, 1 ]); | |||
281 | sket chPlane = f.NewSketc hPlane(pla ne); | 281 | sket chPlane = f.NewSketc hPlane(pla ne); | |||
282 | 282 | |||||
283 | // c reate the extrusion | 283 | // c reate the extrusion | |||
284 | extr usions[i] = f.NewExt rusion(isS olid[i], p rofile, sk etchPlane, | 284 | extr usions[i] = f.NewExt rusion(isS olid[i], p rofile, sk etchPlane, | |||
285 | extrusionO ffsets[i, 1]); | 285 | extrusionO ffsets[i, 1]); | |||
286 | extr usions[i]. StartOffse t = extrus ionOffsets [i, 0]; | 286 | extr usions[i]. StartOffse t = extrus ionOffsets [i, 0]; | |||
287 | m_co mbineEleme nts.Append (extrusion s[i]); | 287 | m_co mbineEleme nts.Append (extrusion s[i]); | |||
288 | } | 288 | } | |||
289 | 289 | |||||
290 | #endregi on | 290 | #endregi on | |||
291 | 291 | |||||
292 | #region Create the round ext rusions | 292 | #region Create the round ext rusions | |||
293 | 293 | |||||
294 | for (int i = 3; i <= 4; ++i) | 294 | for (int i = 3; i <= 4; ++i) | |||
295 | { | 295 | { | |||
296 | // c reate the profile | 296 | // c reate the profile | |||
297 | prof ile = app. NewCurveAr rArray(); | 297 | prof ile = app. NewCurveAr rArray(); | |||
298 | 298 | |||||
299 | curv es = app.N ewCurveArr ay(); | 299 | curv es = app.N ewCurveArr ay(); | |||
300 | plan e = new Pl ane(profil eData[i, 0 ], profile Data[i, 1] ); | 300 | plan e = new Pl ane(profil eData[i, 0 ], profile Data[i, 1] ); | |||
301 | curv es.Append( app.NewArc (plane, ar cRadius, 0 , Math.PI * 2)); | 301 | curv es.Append( app.NewArc (plane, ar cRadius, 0 , Math.PI * 2)); | |||
302 | prof ile.Append (curves); | 302 | prof ile.Append (curves); | |||
303 | 303 | |||||
304 | // c reate the sketch pla ne | 304 | // c reate the sketch pla ne | |||
305 | plan e = app.Ne wPlane(ske tchPlaneDa ta[i, 0], sketchPlan eData[i, 1 ]); | 305 | plan e = app.Ne wPlane(ske tchPlaneDa ta[i, 0], sketchPlan eData[i, 1 ]); | |||
306 | sket chPlane = f.NewSketc hPlane(pla ne); | 306 | sket chPlane = f.NewSketc hPlane(pla ne); | |||
307 | 307 | |||||
308 | // c reate the extrusion | 308 | // c reate the extrusion | |||
309 | extr usions[i] = f.NewExt rusion(isS olid[i], p rofile, sk etchPlane, | 309 | extr usions[i] = f.NewExt rusion(isS olid[i], p rofile, sk etchPlane, | |||
310 | extrusionO ffsets[i, 1]); | 310 | extrusionO ffsets[i, 1]); | |||
311 | extr usions[i]. StartOffse t = extrus ionOffsets [i, 0]; | 311 | extr usions[i]. StartOffse t = extrus ionOffsets [i, 0]; | |||
312 | m_co mbineEleme nts.Append (extrusion s[i]); | 312 | m_co mbineEleme nts.Append (extrusion s[i]); | |||
313 | } | 313 | } | |||
314 | 314 | |||||
315 | #endregi on | 315 | #endregi on | |||
316 | } | 316 | } | |||
317 | 317 | |||||
318 | // / <summary > | 318 | // / <summary > | |||
319 | // / create t he connect ors on the extrusion s | 319 | // / create t he connect ors on the extrusion s | |||
320 | // / </summar y> | 320 | // / </summar y> | |||
321 | pr ivate void CreateCon nectors() | 321 | pr ivate void CreateCon nectors() | |||
322 | { | 322 | { | |||
323 | List<Pla narFace> m _planarFac es = null; | 323 | List<Pla narFace> m _planarFac es = null; | |||
324 | Paramete r param = null; | 324 | Paramete r param = null; | |||
325 | 325 | |||||
326 | #region Create the Supply Ai r duct con nector | 326 | #region Create the Supply Ai r duct con nector | |||
327 | 327 | |||||
328 | // get t he planar faces of e xtrusion1 | 328 | // get t he planar faces of e xtrusion1 | |||
329 | m_planar Faces = Ge tPlanarFac es(extrusi ons[1]); | 329 | m_planar Faces = Ge tPlanarFac es(extrusi ons[1]); | |||
330 | 330 | |||||
331 | // creat e the Supp ly Air duc t connecto r | 331 | // creat e the Supp ly Air duc t connecto r | |||
332 | DuctConnec tor connSupply Air = f.NewDuctC onnector(m _planarFac es[ 5 ].Referenc e, | 332 | DuctConnec tor connSupply Air = f.NewDuctC onnector(m _planarFac es[ 0 ].Referenc e, | |||
333 | Duct SystemType .SupplyAir ); | 333 | Duct SystemType .SupplyAir ); | |||
334 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_HEIGH T); | 334 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_HEIGH T); | |||
335 | param.Se t(connecto rDimension s[0, 0]); | 335 | param.Se t(connecto rDimension s[0, 0]); | |||
336 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_WIDTH ); | 336 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_WIDTH ); | |||
337 | param.Se t(connecto rDimension s[0, 1]); | 337 | param.Se t(connecto rDimension s[0, 1]); | |||
338 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_D IRECTION_P ARAM); | 338 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_D IRECTION_P ARAM); | |||
339 | param.Se t(2); | 339 | param.Se t(2); | |||
340 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_C ONFIGURATI ON_PARAM); | 340 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_C ONFIGURATI ON_PARAM); | |||
341 | param.Se t(1); | 341 | param.Se t(1); | |||
342 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_P ARAM); | 342 | param = connSupply Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_P ARAM); | |||
343 | param.Se t(flow); | 343 | param.Se t(flow); | |||
344 | 344 | |||||
345 | #endregi on | 345 | #endregi on | |||
346 | 346 | |||||
347 | #region Create the Return Ai r duct con nector | 347 | #region Create the Return Ai r duct con nector | |||
348 | 348 | |||||
349 | // get t he planar faces of e xtrusion2 | 349 | // get t he planar faces of e xtrusion2 | |||
350 | m_planar Faces = Ge tPlanarFac es(extrusi ons[2]); | 350 | m_planar Faces = Ge tPlanarFac es(extrusi ons[2]); | |||
351 | 351 | |||||
352 | // creat e the Retu rn Air duc t connecto r | 352 | // creat e the Retu rn Air duc t connecto r | |||
353 | DuctConn ector conn ReturnAir = f.NewDuc tConnector (m_planarF aces[0].Re ference, | 353 | DuctConn ector conn ReturnAir = f.NewDuc tConnector (m_planarF aces[0].Re ference, | |||
354 | Duct SystemType .ReturnAir ); | 354 | Duct SystemType .ReturnAir ); | |||
355 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_HEIGH T); | 355 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_HEIGH T); | |||
356 | param.Se t(connecto rDimension s[1, 0]); | 356 | param.Se t(connecto rDimension s[1, 0]); | |||
357 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_WIDTH ); | 357 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.CONNE CTOR_WIDTH ); | |||
358 | param.Se t(connecto rDimension s[1, 1]); | 358 | param.Se t(connecto rDimension s[1, 1]); | |||
359 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_D IRECTION_P ARAM); | 359 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_D IRECTION_P ARAM); | |||
360 | param.Se t(1); | 360 | param.Se t(1); | |||
361 | param = | 361 | param = | |||
362 | conn ReturnAir. get_Parame ter(BuiltI nParameter .RBS_DUCT_ FLOW_CONFI GURATION_P ARAM); | 362 | conn ReturnAir. get_Parame ter(BuiltI nParameter .RBS_DUCT_ FLOW_CONFI GURATION_P ARAM); | |||
363 | param.Se t(1); | 363 | param.Se t(1); | |||
364 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_P ARAM); | 364 | param = connReturn Air.get_Pa rameter(Bu iltInParam eter.RBS_D UCT_FLOW_P ARAM); | |||
365 | param.Se t(flow); | 365 | param.Se t(flow); | |||
366 | 366 | |||||
367 | #endregi on | 367 | #endregi on | |||
368 | 368 | |||||
369 | #region Create the Supply Hy dronic pip e connecto r | 369 | #region Create the Supply Hy dronic pip e connecto r | |||
370 | 370 | |||||
371 | // get t he planar faces of e xtrusion3 | 371 | // get t he planar faces of e xtrusion3 | |||
372 | m_planar Faces = Ge tPlanarFac es(extrusi ons[3]); | 372 | m_planar Faces = Ge tPlanarFac es(extrusi ons[3]); | |||
373 | 373 | |||||
374 | // creat e the Hydr onic Suppl y pipe con nector | 374 | // creat e the Hydr onic Suppl y pipe con nector | |||
375 | PipeConn ector conn SupplyHydr onic = f.N ewPipeConn ector(m_pl anarFaces[ 0].Referen ce, | 375 | PipeConn ector conn SupplyHydr onic = f.N ewPipeConn ector(m_pl anarFaces[ 0].Referen ce, | |||
376 | Pipe SystemType .SupplyHyd ronic); | 376 | Pipe SystemType .SupplyHyd ronic); | |||
377 | param = connSupply Hydronic.g et_Paramet er(BuiltIn Parameter. CONNECTOR_ RADIUS); | 377 | param = connSupply Hydronic.g et_Paramet er(BuiltIn Parameter. CONNECTOR_ RADIUS); | |||
378 | param.Se t(arcRadiu s); | 378 | param.Se t(arcRadiu s); | |||
379 | param = | 379 | param = | |||
380 | conn SupplyHydr onic.get_P arameter(B uiltInPara meter.RBS_ PIPE_FLOW_ DIRECTION_ PARAM); | 380 | conn SupplyHydr onic.get_P arameter(B uiltInPara meter.RBS_ PIPE_FLOW_ DIRECTION_ PARAM); | |||
381 | param.Se t(2); | 381 | param.Se t(2); | |||
382 | 382 | |||||
383 | #endregi on | 383 | #endregi on | |||
384 | 384 | |||||
385 | #region Create the Return Hy dronic pip e connecto r | 385 | #region Create the Return Hy dronic pip e connecto r | |||
386 | 386 | |||||
387 | // get t he planar faces of e xtrusion4 | 387 | // get t he planar faces of e xtrusion4 | |||
388 | m_planar Faces = Ge tPlanarFac es(extrusi ons[4]); | 388 | m_planar Faces = Ge tPlanarFac es(extrusi ons[4]); | |||
389 | 389 | |||||
390 | // creat e the Hydr onic Retur n pipe con nector | 390 | // creat e the Hydr onic Retur n pipe con nector | |||
391 | PipeConn ector conn ReturnHydr onic = f.N ewPipeConn ector(m_pl anarFaces[ 0].Referen ce, | 391 | PipeConn ector conn ReturnHydr onic = f.N ewPipeConn ector(m_pl anarFaces[ 0].Referen ce, | |||
392 | Pipe SystemType .ReturnHyd ronic); | 392 | Pipe SystemType .ReturnHyd ronic); | |||
393 | param = connReturn Hydronic.g et_Paramet er(BuiltIn Parameter. CONNECTOR_ RADIUS); | 393 | param = connReturn Hydronic.g et_Paramet er(BuiltIn Parameter. CONNECTOR_ RADIUS); | |||
394 | param.Se t(arcRadiu s); | 394 | param.Se t(arcRadiu s); | |||
395 | param = | 395 | param = | |||
396 | conn ReturnHydr onic.get_P arameter(B uiltInPara meter.RBS_ PIPE_FLOW_ DIRECTION_ PARAM); | 396 | conn ReturnHydr onic.get_P arameter(B uiltInPara meter.RBS_ PIPE_FLOW_ DIRECTION_ PARAM); | |||
397 | param.Se t(1); | 397 | param.Se t(1); | |||
398 | 398 | |||||
399 | #endregi on | 399 | #endregi on | |||
400 | 400 | |||||
401 | } | 401 | } | |||
402 | } | 402 | } | |||
403 | } | 403 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2006 Araxis Ltd (www.araxis.com). All rights reserved.