Ok, we shall begin the first post in the Python and the Revit API Tutorial series by having a look at the Python Node and its features…

Let’s start off by placing a fresh Python node in our Dynamo script. You can do this by searching “Python” in the Library Panes Search box or by right clicking and typing “Python”. This will create a brand-new Python Node Instance and should look like this…

Python Node straight out of the box

IN Ports

Just like the List.Create node, you’ll see some “+” and “-“ buttons, these are used to add and remove the “IN” ports to the node. The IN ports are what you will be using to pass data into the script and having control over how many ports you have is very useful as you will see later when we create our first script.


You can have as many as you want, that could be 20 or none (not all scripts require a port as we’ll see later)

OUT Port

Unlike the IN ports, you only get one OUT port. You may be thinking “What if I need more than one output?!?!”, well, don’t sweat, we’ll handle that inside the actual script with nested arrays/lists. This way you can output as much as you want through one port and manage the data after.

No Lacing

Unlike most other nodes, the Python node doesn’t support “Lacing” (if you are unsure what Lacing is please go have a look at the Dynamo Primer as this explains it rather well).

Lacing is instead done either within the script itself by the person scripting, or by packaging up the Python Node (and any other nodes you need) in a Custom Node. Again, if you are unsure about Custom Nodes or how to create them, please have a look at the Dynamo Primer as I will not be covering that.

Note: No Lacing icon

Python Popup Window

If you have ever scripted Grasshopper you will have seen this type of thing before. Unlike Grasshopper though, the Popup is not modeless (basically, you can’t peruse your graph while the popup is open and you must close it first and then Run the script).

For those who haven’t scripted in Grasshopper, if you Double Click on the main body of the node, a new window pops up and you get a scripting interface. This is where we will be doing the majority of our work.


Standard Features

The node also has the same standard features as every other node. You can rename it to whatever you want. Note: this is good practice that you rename your Python Node as it lets you and others know what it does. I usually suffix the name with (Py) to let me know it’s a Python Node, something I picked up when using Grasshopper as Grasshopper has a Python,VB and C# node.

It also has the standard Drop-Down list you’ll see on nearly all nodes that lets you know what the output is. This is really useful when debugging as you can see what is being returned when you run it.


That about covers our quick tour…

In the next tutorial we will have A quick look inside the Python Node