Best approach to learning how to apply C3D API in Dynamo

I’ve found that the most effective way–by far–to learn Dynamo is by starting with a problem or task and then going backwards, figuring out how to solve it in Dynamo. In the short time I’ve been doing this (with help from this forum), I’m already finding problems that I think can’t be solved without some custom API code.

I found Autodesk’s video “Getting Started With AutoCAD Civil 3D .NET Programming”; but my understanding is Dynamo uses Python for custom code, whereas .NET programming is done in VBA.

So Dynamo utilizes the API with Python as opposed to VBA; is that correct?

Just wondering if I’ve generally got this right, before I get too far into the weeds. How should I best approach learning how to implement API in Dynamo?

(Disclosure: I’m not a programmer; but ready to learn. I’ve dabbled a bit in Python, and it certainly seems to be more pleasant than VBA, haha…)

You can use C# to call the .net api and make new nodes which can be brought into the node library, or you can make calls to the .net api via the Iron Python integration.

Both will require some additional efforts and conversions which don’t show in the api documentation which is directly tied to building your own add-ins.

I recommend looking into the Autodesk University workshops on the topic, as they explain much of that effort very well, though there they are focused on the Revit side of things.

The Dynamo Python Primer is also pretty good for educational purposes on the up front content: Take Dynamo Further 🚀 - Dynamo Python Primer

Also on the Python side of things: learn to import the inspect module and utilize inspect.getmembers(*variable*) as this will directly expose what you can do to a given class, object, module, etc…

6 Likes

Thanks so much for this.
I had not heard of that Dynamo Python Primer. This is just what I was looking for.

1 Like