Coding Python Nodes for Dynamo for Civil 3D in an External IDE

Jacob, Thanks for the reply!

That makes a lot of sense. In Dynamo, the Dynamo application is pointing to the active autoCAD application instance. I think reading the raw text of the file and using the python script from string node seems really useful but would mostly just be helping me not copy and paste as much to the python node in Dynamo.

I think the main draw for me to be able to use a jupyter notebook is that I can easily test and dissect code in bite size pieces without having to add comments repeatedly, easy access to documentation in the application without having to run the dynamo graph, ect. It has proved incredibly useful to me with ArcGIS Pro but I know there is something similar there where I have to actually load my jupyter notebook from the python environment that is installed with ArcGIS Pro to be able to code with “arcpy”.

But I think the advantages are very limited if I can’t actually run any code. I know @zachri.jensen had recommended using an external IDE such as pycharm for python nodes. Now I see that he was probably referring to coding in that environment and then copying it over? Not actually running the code in the external IDE.

Also, I hadn’t heard of “zero touch nodes” before. But after looking it up I see that they are custom nodes such as the nodes in the camber package, ect. My intent with this was to write code that can be copied and pasted into a python node to help those on the forums with discrete issues that don’t necessarily warrant its own node and can be edited by the individual in dynamo. I believe if I were to write “zero touch” nodes, they wouldn’t be editable by the users and they would be difficult to share without releasing as a package, correct? Also, I unfortunately only know Python/HTML/CSS/Javascript right now and have no C# experience. (Although I do plan to work through Anton’s book on C# for AutoCAD now that it is in English).

I think the following may be a good question for @solamour: Is there a way to “hook” into an active instance of the Civil 3D/AutoCAD application in an external IDE when using python?

1 Like