# Revit vs Dynamo API

**URL:** <https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641>\
**Category:** Revit\
**Tags:** python\
**Created:** [December 22, 2021, 1:56pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641 "2021-12-22T13:56:58Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 22, 2021, 1:56pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/1 "2021-12-22T13:56:58Z")

</div>

Hello,

I am starting to learn dynamo python through [Primer](https://dynamopythonprimer.gitbook.io/dynamo-python-primer/). I am interested to know which of these two APIs I should concentrate on? Revit or Dynamo API? I would prefer concentrating on a single one, instead of both.  
As I understood, Dynamo can also access Revit API (through `UnwrapElement(IN[0])`).

Learning Revit API can one day help in case I want to switch to Revit plugins, instead of using Dynamo.  
But I see that Dynamo on the other hand is quite fast and powerful, and can achieve results in a matter of minutes, which is not the case with plugins.

Are there some opinions on which of these two APIs are more beneficial? The pros and cons?  
Which one has more online examples?  
What about documentation? Is there an online/offline Dynamo API alternative similar to [revitapidocs](https://www.revitapidocs.com/)?  
Are there some important functionalities which Revit API has - and Dynamo API does not, and vice-versa?

I would be grateful to hear experiences.

---

<div class="post-metadata">

**Author:** ![mclough](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mclough/32/134664_2.png) [@mclough](https://forum.dynamobim.com/u/mclough)\
**Post date:** [December 22, 2021, 4:42pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/2 "2021-12-22T16:42:59Z")

</div>

you’ll effectively be learning both at the same time. Understanding what to do with dynamo nodes requires understanding the API, and eventually you’ll want to do something that’s easier to execute with a direct API call via Python (so you’re really learning 3 things)

But you can get pretty far with just dynamo nodes and designscript.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 22, 2021, 8:03pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/3 "2021-12-22T20:03:57Z")

</div>

I recommend starting with neither API.

First learn how the nodes work directly, then transition into Design Script as it’s a great starter language for coding, and then move into Python (focusing on Python 3 as most of the Python 2 stuff is no longer necessary) and the relevant APIs (Both Dynamo and Revit as your will need both).

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 23, 2021, 10:46pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/4 "2021-12-23T22:46:00Z")

</div>

Hi @mclough , @jacob.small ,

Thank you for the replies.

I agree about learning standard dynamo nodes, but is learning Designscript that necessary? I would rather skip it, and go straight with the dynamo python.

I am familiar with python v2, and I don’t think the transition to python v3 ([source](https://dynamobim.org/why-has-dynamo-switched-to-python-3-should-i-update-too), [source2](https://github.com/DynamoDS/Dynamo/wiki/Work-in-progress-to-improve-Python-3-support)) will be that [painful](https://forum.dynamobim.com/t/new-feature-preview-python-3-support-issue-thread/51649?), as I am already using all the concepts mentioned in the ‘source’.

Where can I find API documentation for Dynamo (not Revit) classes, methods?  
I found this:

[https://dictionary.dynamobim.com/#/Geometry](https://dictionary.dynamobim.com/#/Geometry)

but that’s documentation for standard dynamo nodes, not Dynamo API. Is there at least an offline Dynamo API documentation as some .chm file?

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [December 24, 2021, 12:42am UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/5 "2021-12-24T00:42:00Z")

</div>

Sorry, by Dynamo API, are you referring to the actual Dynamo application API? If so, you should be able to find out more on Dynamo Github…

> **[API Changes · DynamoDS/Dynamo Wiki](https://github.com/DynamoDS/Dynamo/wiki/API-Changes)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 24, 2021, 1:02am UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/6 "2021-12-24T01:02:34Z")

</div>

Hi @Daniel_Woodcock1 ,

Thank you for the reply.  
What I meant by Dynamo API are the properties and methods of the objects used inside the Dynamo Python node.

For example, [‘CutainPanel’ object inside Dynamo Python node has a property ‘Boundaries’](https://forum.dynamobim.com/t/curtainpanel-boundaries-in-dynamo-python/71636/6), while its Revit counterpart ‘Panel’ object, [has no such property](https://www.revitapidocs.com/2019/41f2287f-1e79-fe4b-b6cc-3be77731ff3a.htm).  
Where can I find the Dynamo documentation on ‘Boundaries’ property?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 24, 2021, 2:16am UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/7 "2021-12-24T02:16:51Z")

</div>

I would recommend learning to use the inspect module in Python for much of this.

However the best way to learn this will be via DesignScript, as the node to code function will help you learn the notation, and those notations are pretty much 1-1 into Python.

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [December 24, 2021, 9:54am UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/8 "2021-12-24T09:54:10Z")

</div>

Ah, I see. I don’t think there is such API docs other than dynamo itself and Dynamo Dictionary. You could again always look on the Dynamo Revit Github…

> **[DynamoRevit/src/Libraries/RevitNodes at master · DynamoDS/DynamoRevit](https://github.com/DynamoDS/DynamoRevit/tree/master/src/Libraries/RevitNodes)**
>
> master/src/Libraries/RevitNodes

But I think I understand what you mean in your initial question a bit better. I would recommend the following…

- For anyone new to Programming/Dynamo, learn dynamo first as it will really boost your understanding of how programming works.

- For anyone comfortable with Dynamo but new to programming/python. Start with converting your graph to code. This is pretty easy and can be done with any built-in node. As for Revit, I would start with Dynamo Revit and not pure Revit API, again, it’s easier to convert which gives a shallower learning curve than jumping straight into the Revit API.

- For anyone that is comfortable with both python/programming and dynamo. Then jump straight into the Revit API. The Revit API has lots that Dynamo doesn’t have, particularly when you are using it in Plugins, so using dynamo as a sandbox is a good way to learn initially and also debug later.

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 24, 2021, 10:11am UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/9 "2021-12-24T10:11:49Z")

</div>

Hi @Daniel_Woodcock1 ,  
Thank you for the reply.  
I see that [link](https://github.com/DynamoDS/DynamoRevit/tree/master/src/Libraries/RevitNodes) contains C# source code of the Dynamo itself.  
I am stunned that after more than 6 years of its existence, Autodesk to this day does not have Dynamo API documentation.  
I didn’t understand you this part:

> [@](#):
>
> For anyone comfortable with Dynamo but new to programming/python. Start with converting your graph to code. This is pretty easy and can be done with any built-in node.

If I am converting the graph to code, why do I need the built-in nodes? They are Dynamo standard nodes, thus not code nodes? Forgive me if I understood you incorrectly.

Hi @jacob.small ,  
Thank you for the reply. too.  
`inspect` module does not work on majority of Dynamo objects in IronPython2. Here is an example of its main `getmembers` function, and an error it produces:

[inspect fail.dyn](https://forum.dynamobim.com/uploads/short-url/gCxpvkezBYzatZL7bjfg36MCu58.dyn) (6.1 KB)

```python
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import sys

sys.path.append(R'C:\Program Files (x86)\IronPython 2.7\Lib')
import inspect

el_L = IN[0]
el = el_L[0]

OUT = inspect.getsource( el ) # raises an error:

```

`TypeError: cannot access protected member internalElementId without a python subclass of CurtainPanel.`

Nevertheless, I can use the `dir` instead. But that is not the point.

Where can I find that DesignScript documentation you mentioned? And [I don’t mean the DesignScript language syntax](https://dynamobim.org/wp-content/links/DesignScriptGuide.pdf), but the API (classes, properties) of Dynamo DesignScript?

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [December 24, 2021, 10:57am UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/10 "2021-12-24T10:57:33Z")

</div>

I’m still not entirely sure what you are after. You used CurtainPanel.Boundaries as an example, but this is documented in the dynamo library view by going to Revit \> Elements \> Curtain Panel \> boundaries. Or documented on the Dynamo dictionary site…

[https://dictionary.dynamobim.com/#/Revit/Elements/CurtainPanel/Query/Boundaries](https://dictionary.dynamobim.com/#/Revit/Elements/CurtainPanel/Query/Boundaries)

This returns a polycurve in which you can again just use either Dynamo App library to find what members this object has or again just use dynamo dictionary.

All public members for ds types have some degree of documentation. Is there a specific case where you don’t have documentation?

As for your question, why do you need the Built in nodes, well the built in nodes are the Dynamo Revit API (which is a limited wrapper around the Revit API which extends the Revit API in places or simply exposing it within a DS friendly context). As you said, the Revit API Panel doesn’t have this member called boundaries and in this case you may choose to save yourself some time writing the python code to get the boundaries and instead converting to DS object and then using OOTB CurtainPanel.Boundaries function. If you don’t want to use the built in nodes, then just use the Revit API directly which is also well documented. NOTE: If you are looking to write Plugins, then you also won’t be able to use the Dynamo OOTB nodes, so if you rely on functionality of a node (in graph or in code), you will need to write your own equivalent function from scratch or convert C# version to python in your own code.

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 24, 2021, 12:58pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/11 "2021-12-24T12:58:39Z")

</div>

Thank you for the patience and helpful replies, once again @Daniel_Woodcock1

> [@Daniel\_Woodcock1](#):
>
> I’m still not entirely sure what you are after. You used CurtainPanel.Boundaries as an example, but this is documented in the dynamo library view by going to Revit \> Elements \> Curtain Panel \> boundaries. Or documented on the Dynamo dictionary site…
> 
> [Dynamo Dictionary](https://dictionary.dynamobim.com/#/Revit/Elements/CurtainPanel/Query/Boundaries)
> 
> This returns a polycurve in which you can again just use either Dynamo App library to find what members this object has or again just use dynamo dictionary.
> 
> All public members for ds types have some degree of documentation. Is there a specific case where you don’t have documentation?

That makes it more clear for me now.  
What I was hopping is that Dynamo API documentation has already been released, in the similar form to any other API documentation, or at least close to that. For example, this is the screenshot of the Revit API’s ‘Panel’ class from the ‘RevitAPI.chm’ SDK documentation shipped with Revit installation:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/acaf5bdea065a703c3d30adf9995620c9213442c.png)

It clearly shows all the methods and properties of the ‘Panel’ class.

In Dynamo’s case, due to non-existence of the API documentation, I don’t know which other methods or properties exist for the ‘CurtainPanel’ class, because both Dynamo Library and Dynamo Dictionary show only 10 in total:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/7/37f6ac1cf4982dde88d5ae41ab12b25088b3878d.png)  
So what I would have to go to Dynamo Library/Dictionary: Revit → Elements → Element, and check which methods and properties are there, in order to know which additional ones are available for the ‘CurtainPanel’ class (because ‘CurtainPanel’ inherits from ‘Element’ class).  
This is all very tedious, but I guess without the Dynamo API, there is no other way.

> [@"Daniel\_Woodcock1](#):
>
> As for your question, why do you need the Built in nodes, well the built in nodes are the Dynamo Revit API (which is a limited wrapper around the Revit API which extends the Revit API in places or simply exposing it within a DS friendly context). As you said, the Revit API Panel doesn’t have this member called boundaries and in this case you may choose to save yourself some time writing the python code to get the boundaries and instead converting to DS object and then using OOTB CurtainPanel.Boundaries function. If you don’t want to use the built in nodes, then just use the Revit API directly which is also well documented. NOTE: If you are looking to write Plugins, then you also won’t be able to use the Dynamo OOTB nodes, so if you rely on functionality of a node (in graph or in code), you will need to write your own equivalent function from scratch or convert C# version to python in your own code.

Thank you for the clarification on this as well.  
The sentence which initially confused me is this last one:

> [@](#):
>
> Start with converting your graph to code. This is pretty easy and can be done with any built-in node.

This meant that I should start calling the same methods and properties in dynamo python node, as the names of the existing dynamo built-in nodes?  
For example, there is a dynamo built-in node: ‘CurtainPanel.Boundaries’, so I would in dynamo python node call the property with the same name on ‘Revit.Element’ object.  
Did I understand you correctly?

---

<div class="post-metadata">

**Author:** ![Daniel\_Woodcock1](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@Daniel\_Woodcock1](https://forum.dynamobim.com/u/Daniel_Woodcock1)\
**Post date:** [December 24, 2021, 2:01pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/12 "2021-12-24T14:01:58Z")

</div>

No worries. 🙂

> [@george](#):
>
> In Dynamo’s case, due to non-existence of the API documentation, I don’t know which other methods or properties exist for the ‘CurtainPanel’ class, because both Dynamo Library and Dynamo Dictionary show only 10 in total:

Yup, correct. That is because the Dynamo Revit “API” only has those 10 functions, there is no such thing as a CurtainPanel class in Revit (although we all know it as curtain panel), this is exclusively a Dynamo Revit object and created to wrap around and extend Revit’s Panel class with useful features (like CurtainPanel.Boundaries) which simply do not exist in the Revit API.

As for API docs, Dynamo does not need a .chm as it is in it’s own right sort of a .chm just with a prettier UI and where you can drag the members in a handy graph.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/a/aaa3dd2de009b2d26d5e7ebeb9937f658a09e154.png)

Kinda the same thing no?

> [@george](#):
>
> This meant that I should start calling the same methods and properties in dynamo python node, as the names of the existing dynamo built-in nodes?  
> For example, there is a dynamo built-in node: ‘CurtainPanel.Boundaries’, so I would in dynamo python node call the property with the same name on ‘Revit.Element’ object.  
> Did I understand you correctly?

Correct. The nodes in Dynamo are just method calls on an object, you can call these within python code. These all use the Dynamo Revit “API” if you will, not the proper Revit API. I write an article about this some time ago on how to execute Revit Nodes inside Python. It is no different from how you would with ProtoGeometry Nodes.

> **[Revit Nodes Vs Revit API…](https://danimosite.wordpress.com/2018/10/14/revit-nodes-vs-revit-api/)**
>
> Today I saw a post on the Dynamo Forum where there was confusion between using Element.SetParameterByName() on a Revit API Element in python and it failing. For beginners (and even some intermediat…

For example, the node Element.SetParameterByName can be written equivalently in python like this…

```auto
 elem = Revit.Elements.Element.SetParameterByName(e,n,v)

```

When using Dynamo Revit methods, you are limited to ONLY what is in the OOTB Library (Dynamo Revit API if you will), which is ever expanding, but still limited when compared to the Revit API. Using the Revit API directly is much more flexible down the line, but you can lose some useful functionality you had when using the Dynamo Revit API. But you can also use them in tandem by converting to and from DS/Revit types. Which type matters here, Dynamo Revit API can operate on DS Types and Revit API can only operate Revit Types (or unwrapped DS Types).

Hope that makes sense! 🙂

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [December 24, 2021, 2:46pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/13 "2021-12-24T14:46:31Z")

</div>

Hi,  
You can also use fuget

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/b/8bec95bf910f433f5f9f334b5ba066f92a6ca23f.png)

> **[ProtoGeometry.dll](https://fuget.azurewebsites.net/packages/DynamoVisualProgramming.ZeroTouchLibrary/2.13.0.3485/lib/net48/ProtoGeometry.dll)**
>
> Assembly with 3 public namespaces (183,944 bytes)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [December 24, 2021, 3:39pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/14 "2021-12-24T15:39:26Z")

</div>

`inspect.getmembers(el)` should give you valid results.

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 25, 2021, 3:57pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/15 "2021-12-25T15:57:52Z")

</div>

Thank you @Daniel_Woodcock1 ,  
For the further explanations and your article. It was quite useful in clearing some of my doubts!

I would still disagree on the documentation of Revit API vs Dynamo API 🙂 . I am aware that ‘CurtainPanel’ and ‘Panel’ classes are not the same. I just gave them as a comparison.  
Dynamo Library/Dictionary shows only 10 methods+properties, while in reality there should be 49 of them (the other 39 are probably inherited from ‘Revit.Elements.Element’ class).

@c.poupin ,  
Thank you very much for the link. I was more looking for the Revit DesignScript Nodes API documentation.

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://forum.dynamobim.com/u/george)\
**Post date:** [December 25, 2021, 4:04pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/16 "2021-12-25T16:04:11Z")

</div>

Hi @jacob.small ,

On Revit 2019 and 2020; Dynamo 2.0.2 and 2.0.3; and Ironpython2, I get an error message when `inspect.getmembers(el)` is called.

Here is an example calling it on a Dynamo object:

 ![inspect.getmembers_error_on_DS_obj](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/0/708de67b52e606cfd962f31eeb63bf7d9e1c68a8.png)

And on a Revit object:

 ![inspect.getmembers_error_on_Revit_obj](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2fc067d052a4cb98ba2e411a706b08cbfc4d8ba5.png)

I attached the files.  
[example.dyn](https://forum.dynamobim.com/uploads/short-url/hsQWLnIZGp7Gb5C2ki3h0ydK0sN.dyn) (7.4 KB)  
[example.rvt](https://forum.dynamobim.com/uploads/short-url/zfZg93wlauQSxVmIZCdfm3SzI4V.rvt) (3.0 MB)

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [December 25, 2021, 9:36pm UTC](https://forum.dynamobim.com/t/revit-vs-dynamo-api/71641/17 "2021-12-25T21:36:55Z")

</div>

An alternative to the dir() method for .Net objects

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/8/f81fe408bce4289dbde0162418a2a67300cd9eb0.png)

`clr.GetClrType(el.GetType())` can be replaced by `el.GetType()`
