Getting Started With The Revit API
Getting Started With The Revit API
Table of Contents Autodesk Revit 2013 API Getting Started.................................................................................................................................1 vervie!.......................................................................................................................................................................................2 "#at Can I $o "it# t#e Autodesk Revit API%.............................................................................................................................2 "#at &ou "ill 'eed to Get Started..............................................................................................................................................2 (nderstanding Autodesk Revit......................................................................................................................................................2 Installation of t#e Autodesk Revit API.........................................................................................................................................3 $evelo)*ent Re+uire*ents..........................................................................................................................................................3 (sing t#e Autodesk Revit API......................................................................................................................................................3 Autodesk Revit S$, and nline -el)....................................................................................................................................... Documentation Conventions.............................................................................................4 "#at /an 0ou do !it# t#e Autodesk Revit API%........................................................................................................................ Deployment Options........................................................................................................4 1.External commands......................................................................................................4 2.External applications....................................................................................................5 3.REX addins..................................................................................................................5 Registration of add1ins..............................................................................................................................................................2 34ternal Co**ands......................................................................................................................................................................5 T#e I34ternalCo**and Interfa/e.............................................................................................................................................5 Parameters.................................................................................................................... Return !alue.................................................................................................................." Remar#s........................................................................................................................" (sing an Autodesk Revit API 34ternal Co**and...................................................................................................................6 34ternal Co**and b7e/t 8ifeti*e.........................................................................................................................................9 34ternal A))li/ations....................................................................................................................................................................9 T#e I34ternalA))li/ation Interfa/e...........................................................................................................................................9 Parameters....................................................................................................................$ Return !alue..................................................................................................................$ 34ternal A))li/ation b7e/t 8ifeti*e.......................................................................................................................................9 Co*)atibilit0 of API a))li/ations !it# :.1bit Revit..................................................................................................................10 $ebugging &our A))li/ation in ;S <isual Studio 2010...........................................................................................................10 T#e Revit (nit S0ste*................................................................................................................................................................12 Storing and a//essing Custo* $ata for A))li/ations.................................................................................................................12 A))endi4 1 Glossar0 of Autodesk Revit ter*s....................................................................................................................13 A))endi4 2 1 =A>...................................................................................................................................................................13 %eneral&......................................................................................................................13 'utodes# Revit (tructure&..............................................................................................15
Overview
'utodes# Revit 'rc)itecture 2*13+ 'utodes# Revit (tructure 2*13 and 'utodes# Revit ,EP 2*13 o--er an 'P. desi/ned to allo0 po0er users and external application developers to inte/rate t)eir applications 0it) 'utodes# Revit. 1)e 'P.s -or eac) o- t)ese t)ree products are very similar and 0ill 2e 3ointly re-erred to as t)e 'utodes# Revit 2*13 'P. or 'utodes# Revit 'P.. .t is stron/ly recommended t)at you 2ecome -amiliar 0it) 'utodes# Revit 'rc)itecture+ (tructure or ,EP and its -eatures 2e-ore attemptin/ to use t)e 'utodes# Revit 'P.. 1rainin/ can 2e -ound t)rou/) t)e 'utodes# Developer 4et0or# 5'D46.
Autodesk Revit 2013 API Getting Started )ttp&@@000.autodes#.com@revitstructure@ )ttp&@@000.autodes#.com@revitsystems@ )ttp&@@000.autodes#.com@2im@ )ttp&@@discussion.autodes#.com@ (elect A 'utodes# Revit :uildin/ 1)en (elect A 'utodes# Revit 'P.
Deve"o&'ent Re(uire'ents
1)e 'utodes# Revit 'P. re?uires t)e ,icroso-t .4E1 Brame0or# v3.5 or 4.*. 1o edit and de2u/ your 'P. applications+ you need an interactive development environment suc) as ,icroso-t !isual (tudio 2*1* or one o- t)e ,( !isual (tudio Express Editions -or C9 or !isual :asic.4E1. C)en developin/ 0it) t)e 'utodes# Revit 'P.+ ensure t)at your pro3ect re-erences t0o DDDs& RevitAPI.dll and RevitAPIUI.dll contained in t)e 'utodes# Revit Pro/ram directory. (ome pro/rammin/ s#ills are re?uired to e--ectively use t)e 'P.. .- you are a 2e/inner in pro/rammin/+ 0e stron/ly advise you to learn ,icroso-t !isual (tudio 2*1* and one o- t)e compati2le lan/ua/es li#e C9 or !isual :asic.4E1. 1)ere are many /ood 2oo#s and classes to /et you started. Resources: Online resources :oo#s& Code Complete+ (econd Edition+ 2y (teve ,cConnell (o-t0are Pro3ect (urvival %uide+ 2y (teve ,cConnell Bree !isual (tudio E )ttp&@@msdn.microso-t.com@!(tudio@Express@ )ttp&@@000.code/uru.com@ )ttp&@@devx.com@ )ttp&@@000.msdn.microso-t.com@
Revit'P..c)m is t)e 'utodes# Revit 'P. re-erence documentation )elp -ile+ included 0it) t)e (D8 pac#a/e in t)e GRevit 2*13 (D8G -older. Resources: 000.autodes#.com@adn 7 'utodes# Developer 4et0or# )ome 5'D46 000.autodes#.com@developrevit 7 'utodes# Revit development resources )ttp&@@discussion.autodes#.com E 'utodes# product discussion /roups (elect A 'utodes# Revit 'rc)itecture 1)en (elect A 'utodes# Revit 'P. )ttp&@@t)e2uildin/coder.typepad.com@2lo/@ 7 1)e :uildin/ Coder+ an '4D 2lo/ dedicated to Revit codin/ )ttp&@@2imapps.typepad.com@ 7 :im 'pps+ a 2lo/ dedicated to :., applications Documentation Conventions 1)is document 0ill contain names in namespace -ormat+ suc) as Autodesk.Revit.DB.Element
%. E ternal applications 1)e 'utodes# Revit 'P. ena2les you to also add external applications. 1)ese applications are invo#ed durin/ 'utodes# Revit startup and s)utdo0n. 1)ey can create ne0 panels in t)e 'dd7ins ta2+ as seen in Bi/ure 2. 1)ey can also re/ister )andlers t)at can react to events occurrin/ in t)e 'utodes# Revit user inter-ace.
!i"ure % # &e' panels and controls added to Revit (. RE) addins REX 5Revit Extensions6 is an 'P. -rame0or# t)at lets you 2uild applications -or Revit in .4E1 similar to classes t)at implement .ExternalCommand. REX is meant to /ive you a more )i/)7level development environment t)rou/) 2uilt7in resources suc) as& 'utomatic dialo/ 2ox creation and display Di2raries to 0or# 0it) units and /eometry :uilt7in command72ased arc)itecture to ma#e menu and tool2ar development easier. ' standard mec)anism -or accessin/ a re-erence to t)e Revit application o23ect. 'utomatic deployment and installation o- addins -or easy de2u//in/.
Please see t)e IGRevit 2*13 (D8GREX (D8GJ -older -or more details.
Registration o% add.ins
1)e Revit 'P. o--ers t)e a2ility to re/ister 'P. applications via a .addin mani-est -ile. ,ani-est -iles 0ill 2e read automatically 2y Revit 0)en t)ey are places in one o- t0o locations on a userKs system& In a non#user speci*ic location in +application data+ o Bor Cindo0s XP 7 C&GDocuments and (ettin/sG'll <sersG'pplication DataG'utodes#GRevitG'ddinsG2*13G o Bor !ista@Cindo0s 7 C&GPro/ramDataG'utodes#GRevitG'ddinsG2*13G In a user speci*ic location in +application data+ o Bor Cindo0s XP 7 C&GDocuments and (ettin/sGLuserMG'pplication DataG'utodes#GRevitG'ddinsG2*13G o Bor !ista@Cindo0s 7 C&G<sersGLuserMG'ppDataGRoamin/G'utodes#GRevitG'ddinsG2*13G /
Autodesk Revit 2013 API Getting Started 'll -iles named .addin in t)ese locations 0ill 2e read and processed 2y Revit durin/ startup. ' 2asic -ile addin/ one ExternalCommand loo#s li#e t)is& <?xml version="1.0" encoding="utf-16" standalone="no"?> <RevitAddIns> <AddIn !"e="#ommand"> <Assem$l!>c%&'!(rogram&'!(rogram.dll<)Assem$l!> <AddInId>*6e$*00a-+c,--.,,,-a*,d-/1.+0ecae0ed<)AddInId> <1ull#lass2ame>Revit.3am"les.3am"le#ommand<)1ull#lass2ame> < ext>3am"le command<) ext> <4isi$ilit!'ode>2ot4isi$leIn1amil!<)4isi$ilit!'ode> <4isi$ilit!'ode>2ot4isi$leIn'5(<)4isi$ilit!'ode> <Availa$ilit!#lass2ame>Revit.3am"les.3am"leAccessi$ilit!#6ec7 <)Availa$ilit!#lass2ame> <)AddIn> <)RevitAddIns> ' 2asic -ile addin/ one External'pplication loo#s li#e t)is& <?xml version="1.0" encoding="utf-16" standalone="no"?> <RevitAddIns> <AddIn !"e="A""lication"> <2ame>'! sam"le a""lication<)2ame> <Assem$l!>c%&'!(rogram&'!(rogram.dll<)Assem$l!> <AddInId>60.810-+-1*.+-.0-1-,-*6-#+619100/10*<)AddInId> <1ull#lass2ame>Revit.3am"les.3am"leA""lication<)1ull#lass2ame> <)AddIn> <)RevitAddIns> ,ultiple 'dd.n elements may 2e provided in a sin/le mani-est -ile. 1)e ne0 mec)anism currently o--ers t)e -ollo0in/ X,D ta/s& $a" Assembly FullClassName AddInId Description The full path to the add-in assembly file. Required for all ExternalCommands and ExternalApplications. The full name of the class in the assembly file which implements IExternalCommand or IExternalApplication. Required for all ExternalCommands and ExternalApplications. A GUID which represents the id of this particular application. AddInIds must be unique for a given session of Revit. Autodesk recommends you generate a unique GUID for each registered application or command. Required for all ExternalCommands and ExternalApplications. The property :IA""lication.ActiveAddInId provides programmatic access to this value, if required. The name of application. Required; for ExternalApplications only. The name of the button. Optional; use this tag for ExternalCommands only. The default is "External Tool". Short description of the command, will be used as the button tooltip. Optional; use this tag for ExternalCommands only. The default is a tooltip with just the command text. Provides the ability to specify if the command is visible in project documents, family documents, or no document at all. Also provides the ability to specify the discipline(s) where the command should be visible. Multiple values may be set for this option. Optional; use this tag for ExternalCommands only. The default is to display the command in all modes and disciplines, including when there is no active document. Previously 0
Autodesk Revit 2013 API Getting Started written external commands which need to run against the active document should either be modified to ensure that the code deals with invocation of the command when there is no active document, or apply the 2ot4isi$le;6en2oActive9ocument mode. AvailabilityClassName The full name of the class in the assembly file which implemented IExternalCommandAvailability. This class allows the command button to be selectively grayed out depending on context. Optional; use this tag for ExternalCommands only. The default is a command that is available whenever it is visible. The path to the icon to use for the button in the External Tools pulldown menu. The icon should be 32 x 32 pixels for best results. Optional; use this tag for ExternalCommands only. The default is to show a button without an icon. Long description of the command, will be used as part of the button's extended tooltip. This tooltip is shown when the mouse hovers over the command for a long amount of time. You can split the text of this option into multiple paragraphs by placing <p> tags around each paragraph. Optional; use this tag for ExternalCommands only. If neither of this property and TooltipImage are supplied, the button will not have an extended tooltip. The path to an image file to show as a part of the button extended tooltip, shown when the mouse hovers over the command for a longer amount of time. Optional; use this tag for ExternalCommands only. If neither of this property and TooltipImage are supplied, the button will not have an extended tooltip. Localization setting for Text, Description, LargeImage, LongDescription, and TooltipImage of external tools buttons. Revit will load the resource values from the specified language resource dll. The value can be one of the eleven languages supported by Revit. If no LanguageType is specified, the language resource which the current session of Revit is using will be automatically loaded.
LargeImage
LongDescription
TooltipImage
LanguageType
12terna" Co''ands
.mplement support -or a speci-ic inter-ace+ in t)is case 'utodes#.Revit.<...ExternalCommand. 'dds one or more entries to t)e Revit.ini -ile descri2in/ t)e external command.
1ec)nically+ an external command is an exposed .4E1 o23ect t)at supports t)e 'utodes#.Revit.<...ExternalCommand inter-ace. Burt)ermore+ in t)e Revit.ini -ile t)ere must 2e one entry -or eac) suc) o23ect in order -or Revit to 2e a2le to IseeJ and to use t)e commands.
Autodesk Revit 2013 API Getting Started message & 1)e messa/e strin/ can 2e set to supply a speci-ic messa/e to t)e user 0)en t)e command terminates. =o0 t)is messa/e is displayed is dependent upon t)e return value ot)e -unction. (ee t)e remar#s section -or more details. elements & .nitially t)is is an empty set t)at can contain 'utodes# Revit elements. C)en t)e command terminates+ t)e elements 0it)in t)is set may 2e displayed+ 2ased on t)e return value. (ee t)e remar#s section -or more details.
Return ,alue result & 1)e return value can 2e one o- t)e -ollo0in/& 3uccess & .s returned i- t)e command succeeded as expected 0it)out any un)andled error conditions. 1)e external command 0ill appear as an undoa2le operation in t)e 'utodes# Revit user inter-ace. #ancelled & 1)is value speci-ies t)at t)e user re?uested t)at t)e command 2e cancelled. 'ny c)an/es t)at 0ere made to 'utodes# Revit o23ects durin/ t)e external commands execution 0ill 2e undone. ' messa/e may 2e posted+ see t)e Remar#s section. 1ailure & Bailure si/ni-ies t)at t)e external command -ailed in some manner -rom 0)ic) it cannot recover. 'ny c)an/es made to 'utodes# Revit o23ects durin/ t)e execution o- t)e external command 0ill 2e undone. ' messa/e 0ill 2e posted+ see t)e Remar#s section.
Remarks 1)e messa/e and elements parameters are used i- t)e command 0as cancelled or -ailed. #ancelled & .- t)e external command 0as cancelled and t)e messa/e parameter 0as set 2y t)e external command t)en t)e messa/e is displayed 0)en execution is returned 2ac# to 'utodes# Revit. .- t)e messa/e parameter 0as not set t)en no messa/e is displayed and t)e command 0ill exit silently. 1ailed & .- t)e external command -ailed t)en t)e contents o- t)e messa/e parameter 0ill 2e displayed. .- t)e element set contains 'utodes# Revit elements t)en t)ese elements 0ill 2e )i/)li/)ted 0)en t)e error messa/e is displayed t)us /ivin/ t)e developer t)e a2ility to s)o0 t)e user t)e pro2lem elements.
12terna" A&&"i+ations
.mplement support -or a speci-ic inter-ace+ in t)is case 'utodes#.Revit.<...External'pplication. 'dds one or more entries to t)e Revit.ini -ile descri2in/ t)e external application.
1ec)nically+ an external application is an exposed .4E1 o23ect t)at supports t)e 'utodes#.Revit..External'pplication inter-ace. Burt)ermore+ in t)e Revit.ini -ile t)ere must 2e one entry -or eac) suc) o23ect in order -or 'utodes# Revit to 2e a2le to load t)ese applications 0)en 'utodes# Revit starts.
Parameters
Return ,alue result & 1)e return value can 2e one o- t)e -ollo0in/& 3uccess & .s returned i- t)e external application succeeded as expected 0it)out any un)andled error conditions. 1ailure & Bailure si/ni-ies t)at t)e external application -ailed in some manner -rom 0)ic) it cannot recover. #ancelled & 1)is value speci-ies t)at t)e external application 2e cancelled.
4ote t)at t)ere are some ,icroso-t components 5suc) as OleD: provider -or ,icroso-t Qet6 t)at are not supported -or O472it. 'll (D8 samples are set up to 0or# 0it) eit)er 3272it or O472it Revit+ except t)ose samples t)at )ave dependencies to unsupported ,icroso-t components. !or more in*ormation see t-is .icroso*t resource: )ttp&@@msdn.microso-t.com@en7us@li2rary@ms241*O45!(."*6.aspx
3. (elect t)e De2u/ ta2 on t)e le-t 4. (elect t)e I(tart external pro/ram&J radio 2utton 5. Press t)e 2ro0se 2utton and -ind t)e Revit.exe -ile and press Open
10
Autodesk Revit 2013 API Getting Started O. (et some 2rea# points in your source code. . Brom !isual (tudio+ select I(tart De2u//in/J. 'utodes# Revit 0ill launc). ". 1o )it a 2rea# point select t)e option -or your pro/ram -rom t)e External 1ools menu. Once t)e compiler reac)es one o- your 2rea# points it 0ill stop to let you de2u/ your pro/ram.
11
12
Parameter
1)ere are a num2er o- 'utodes# Revit parameter types. /-ared Parameters can 2e t)ou/)t o- as user de-ined varia2les. /ystem Parameters are varia2les t)at are )ard coded in 'utodes# Revit. !amily parameters are varia2les t)at are de-ined 0)en a -amily is created or modi-ied.
Type
' 1ype is a mem2er o- a Bamily. Eac) 1ype )as speci-ic parameters t)at are constant -or all instance o- t)e 1ype t)at exist in your model. 1)ese are called 1ype Properties. 1ypes )ave ot)er parameters called .nstance parameters+ 0)ic) may vary over t)e various instances o- t)is type in your model.
A&&endi2 2 . <A=
0eneral: 1: =o0 do . re-erence an element in 'utodes# RevitS A: Eac) element )as .d and <ni?ue.d properties t)at can 2e used to re-erence t)e element. 1: 're element .Ds universally uni?ue and can t)ey ever c)an/eS A: 't any /iven time+ element .Ds in a Revit model are uni?ue. =o0ever+ multi7user interactions in Revit can result in an element;s .D c)an/in/. 'lso+ anot)er element in a di--erent model may )ave an element 0it) t)e same .D. .- you need to store an .D 5especially an .D o- an element t)at 0as ne0ly created6 in order to -ind t)e element later+ store <ni?ue.d. 1: Can a model only use one s)ared parameter -ileS A: ()ared parameter -iles are used to store a parameter speci-ication. 1)e most important portion o- t)ese parameter descriptions is t)e %<.D t)at is used to insure t)e uni?ueness o- a parameter 2ot) in a sin/le model -ile and across multiple models. 'utodes# Revit can 0or# 0it) multiple s)ared parameter -iles 2ut can only read parameters -rom one -ile at a time. .t is t)en up to you to c)oose t)e same s)ared parameter -ile -or all models or a di--erent one -or eac). 'n 'P. application s)ould avoid inter-erin/ 0it) t)e user;s o0n parameter -ile. >our application s)ould s)ip 0it) a parameter -ile containin/ t)e parameters it re?uires. 1o load t)e parameter5s6 into an 'utodes# Revit -ile+ an application s)ould& (tore t)e name o- t)e user;s parameter -ile+ ,a#e t)e applications parameter -ile current+ Doad t)e re?uired parameter5s6 and+ 13
Autodesk Revit 2013 API Getting Started ,a#e t)e user;s parameter -ile current.
1: Do . need to distri2ute t)e s)ared parameters -ile 0it) t)e model so ot)er pro/rams can use t)e s)ared parametersS A: 4o+ you do not need to distri2ute s)ared parameter -iles. 1)e s)ared parameters -ile is only used to load s)ared parameters. '-ter t)ey are loaded t)e -ile is no lon/er needed -or t)at model. 1: Do s)ared parameter values /et copied 0)en t)e correspondin/ element is copiedS A: >es t)ey do. 1)ere-ore i- you )ave a s)ared parameter t)at )olds a uni?ue .D -or an item in your data2ase it is recommended t)at you ma#e t)is .D include t)e 'utodes# Revit element;s <ni?ue.d property. 1)is 0ill allo0 you to identi-y elements t)at 0ere copied -rom existin/ elements in your application. 1: 'utodes# Revit ta#es a lon/ time to update 0)en my application sends data 2ac# to t)e model. C)at do . need to do to speed it upS A: >ou s)ould use t)e ,anual re/eneration mode to prevent t)e 'P. -rame0or# -rom re/eneratin/ a-ter every model level c)an/e. 1)en+ you 0ill use t)e re/eneration 'P.s to -orce update o- t)e document a-ter a /roup o- c)an/es. Per-ormance o- multiple modi-ications o- t)e Revit document s)ould 2e -aster t)an Re/enerationOption.'utomatic. :ecause t)is mode suspends all updates to t)e document+ your application s)ould not read data -rom t)e document a-ter it )as 2een modi-ied until t)e document )as 2een re/enerated+ or it runs t)e ris# o- accessin/ stale data. 1: C)at do . do i- . 0ant to add s)ared parameters to elements t)at do not )ave t)e a2ility to )ave s)ared parameters 2ound to t)emS Bor example& %rids or ,aterials. A: .- an element type does not )ave t)e a2ility to contain s)ared parameters+ you 0ill need to add a pro3ect parameter. 1)is does ma#e it a 2it more complicated as you 0ill need di--erent code to access t)e value o- t)e parameter on t)ese elements. 1: C)en exportin/ a model containin/ /roups to an external pro/ram+ t)e user receives an error at t)e end o- t)e export& TC)an/es to /roup T%roup 1T are allo0ed only in /roup edit mode. <se t)e Edit %roup command to ma#e t)e c)an/e to all instances o- t)e /roup. >ou may use t)e T<n/roupT option to proceed 0it) t)is c)an/e 2y un/roupin/ t)e c)an/ed /roup instances.T A: Currently t)e 'P. does not permit c)an/es to mem2ers o- /roups. >ou can pro/rammatically un/roup+ ma#e t)e c)an/e+ re/roup and t)en s0ap t)e ot)er instances o- t)e old /roup to t)e ne0 /roup to /et t)e same e--ect. 1: C)y do t0o di--erent Bamily(ym2ols )ave t)e same name in my 'utodes# Revit documentS A: .n t)e 'utodes# Revit 'P.+ (ym2ols represent /eometry. Consider t)at t0o 0indo0 instances o- t)e same type are inserted into 0alls o- di--erent types. 4o0+ t)ese t0o 0indo0 instances re-er to t)e same Bamily(ym2ol and count as 2ein/ o- t)e same type+ 2ut it is clear t)at t)ey cannot possi2ly use t)e same sym2ol;s /eometry+ since insertin/ t)em into 0alls o- di--erent t)ic#ness c)an/es eac) 0indo0;s /eometry to matc). 1o trac# individual instances o- Bamily(ym2ols+ 'utodes# Revit employs a ImasterJ and IslaveJ -unctionality 0it) IslaveJ Bamily(ym2ols localiFin/ t)eir /eometry to surroundin/ conditions accordin/ to t)e ImasterJ Bamily(ym2ol template. 1-
Autodesk Revit 2013 API Getting Started .- t)ere is no door instance in a model+ t)ere is only one ImasterJ Bamily(ym2ol -or a 3OJx"4J door+ 2ut i- a door is inserted+ 'utodes# Revit 0ill create a IslaveJ Bamily(ym2ol -or t)e ne0 3OJx"4J Door. (u2se?uent doors placed in t)e model 0ill cause 'utodes# Revit to /enerate additional IslaveJ Bamily(ym2ols. 1: .s t)e order o- vertices or t)e trian/les in an 'utodes# Revit /eometry mes) o23ect relia2ly sorted in counter7cloc#0ise directionS A: >es. 1: C)y a-ter -lippin/ a 0all or door 52ot) external and internal6 do its properties BromRoom and 1oRoom do not c)an/eS A: External Doors U External Cindo0s )ave only eit)er a BromRoom or a 1oRoom. <sers can decide 0)ic) property exists 0)en locatin/ doors or 0indo0s. .- external doors or 0indo0s are -lipped t)eir BromRoom or 1oRoom properties do not c)an/e automatically+ 2ut can 2e manually c)an/ed.
Autodesk Revit /tructure: 1: (ometimes t)e de-ault end releases o- structural elements render t)e model unsta2le. A: .n some cases t)e user may not )ave paid attention to t)e element end release 0)en modelin/ t)e elements. 1)e 'nalytical ,odel C)ec# -eature 0ill -ind some o- t)ese issues. C)en exportin/ t)e analytical model+ as# t)e user 0)et)er t)ey 0ant to retain t)e release conditions -rom R(1 or t)ey 0ant to set all 2eams and columns to 2e -ixed. C)en re7importin/ t)e model to R(1+ al0ays update t)e end releases and do not over0rite t)e end releases on su2se?uent exports to analysis pro/rams. 1: .Km rotatin/ t)e orientation o- t)e 2eam so it is rotated in t)e 0ea# direction+ i.e. t)e . o- a C14X3* is rotated to loo# li#e an = 2y a $* de/ree rotation. =o0 is t)at rotation an/le accessed in t)e 'P.S :ecause t)e location is a DocationCurve not a DocationPoint . do not )ave access to t)e Rotation value so 0)at is it . need to c)ec#S .Kve /ot a Bamily.nstance element to c)ec# so 0)at do . do 0it) itS A: 1a#e a loo# at t)e RotateBramin/O23ect example in t)e (D8. .t )as examples o- )o0 to /et and c)an/e t)e rotation an/le o- 2eams+ 2races and columns. 1: =o0 do . add ne0 concrete 2eam and column siFes to a modelS A: 1a#e a loo# at t)e Brame:uilder sample code in t)e (D8.
1/
Autodesk Revit 2013 API Getting Started 1: =o0 to vie0 true dec# layerS A: 1)ere is an example called Dec#Properties t)at provides t)e in-ormation on )o0 to /et t)e layer in-ormation -or t)e dec#. 1)e dec# in-ormation is reported in exactly t)e same 0ay as t)e <.. 1)e dec# dimension parameters are s)o0n in t)e -ollo0in/ -i/ure.
1: =o0 do . tell 0)en . )ave a 2eam 0it) a cantileverS A: 1)ere is no direct 0ay in t)e 'utodes# Revit data2ase to tell i- a 2eam )as a cantilever. =o0ever one or more o- t)e options 2elo0 can /ive you a /ood /uess at 0)et)er a 2eam is a cantilever& Options 1. 1)ere are t0o parameters called ,oment Connection (tart and ,oment Connection End. .t)e value t)at is set -or t)ese t0o is not 4one t)en you s)ould loo# and see i- t)ere is a 2eam t)at is co7linear and also )as t)e value set to somet)in/ ot)er t)an 4one. >ou could also as# t)e user to ma#e sure to select t)e Cantilever ,oment option rat)er t)an ,oment Brame option. 2. 1race t)e connectivity 2ac# 2eyond t)e element say one or t0o elements. 3. Doo# at element release conditions. 1: =o0 do . model a -oundation 0it) end over)an/s under a 0allS A: 1)e 0all -oundation capa2ility in 'utodes# Revit (tructure does not support an over)an/ at its ends. 1)e 2est solution is to use t)e -oundation sla2 -eature in t)e %<. or 'P.. >ou can create t)em usin/ t)e 'utodes#.Revit.Creation.Document.4e0Bloor56 met)ods. Bor t)e (1R<C1<R'DRBDOORR'4'D>VE(R'(. >ou 0ill 0ant to use ''R,at or ''R(la2On%rade -or -oundation or ''R(la2 i- it is a -loor.
10