A Robust and Versatile Dynamo
Introduction
If you have not heard the word Dynamo before in relation to Autodesk® Revit®, it is about time you did. It is the newest, most amazing add-in to hit Revit. It is literally the future of Revit and other Autodesk software. It’s hard to explain what Dynamo is because it does so much. For the purposes of this article Dynamo will be kept in the context of being used as an add-in for Revit. Of course, Dynamo could also be used as a standalone program or used as an add-in for other Autodesk programs. Yes, it is an Autodesk program that is open source and free! The software can be downloaded from http://dynamoBIM.org, and source code is at https://github.com/ikeough/Dynamo. It is currently available for Revit 2013, 2014, and 2015.
Design Script and Dynamo Version .70
Dynamo is developing so fast that is has daily builds, meaning that a new version is released on a daily basis. Of course, most of it is untested so there are “stable” builds that are released about every two months or so. The latest version of Dynamo (version .70) had the back-end code rewritten to include and incorporate Design Script methodology.
This article will not go into too much detail about Design Script, but just be aware that all the Dynamo functionality could be done using simple Design Scripting. Design Script is a text-based programming language developed by Autodesk to simplify text programming for designers. When I say simplify, I mean it is the easiest text-based programming language to use. If you want more information on Design Script, visit the following link http://designscript.ning.com/.
Every User Gets to Touch the API
Let’s face it, the Revit API is a very difficult thing to utilize. For the most part you need to be an Autodesk developer or an experienced .net programmer to use the API and write programs. The API was developed for developers by developers and, therefore, many Revit users will find it difficult to understand, let alone try to use.
I am happy to say that Dynamo basically allows users to use the Revit API through visual programming using “nodes” and “wires” instead of text. This means that any Revit user could use the API and create simple custom routines without having to know .net language or without having to hire an outside API consultant.
Dynamo Basics and the Dynamo Interface
Figure 1: The Dynamo node
Nodes are the boxes you place and connect together with wires to form a program. Nodes can represent any function of the API.
Wires connect between nodes to pass information between nodes. Wires flow only in one direction.
Wires connect the output port from one node to the input port of another node. To create a wire, simply use the mouse and left click hold and drag from one port to another port. Wires are dashed while being dragged and then turn solid when connected. You could also pull the wire away to disconnect it from the port.
Information flows through the ports from left to right.
See Figure 2 for all the nomenclature on the Dynamo interface. When you download the latest version of Dynamo, simply click to install it. It will then show up under your “add-in” tab in Revit. Click on the Dynamo button and it will open a separate window that is the Dynamo interface. It is best to use dual monitors when using Dynamo.
Figure 2: The Dynamo interface
The pull-down menu is used to open and save Dynamo files, copy and paste operations, change settings, and access the “Package Manager.” The Package Manager allows Dynamo users to create custom Dynamo nodes with either Python Scripting or Nesting other nodes into each other and then posting them as a “Package” so other Dynamo users can use them. Yes, that’s right—you could become a Dynamo developer and share your custom content!
The Node Library is similar to the view and browser in Revit where it shows all the available nodes.
The Dynamo Canvas is the main “workspace” environment for creation of all Dynamo visual programing. The Execution Bar runs or executes the current workspace. What is unique to programming in Dynamo is the ability to run the program in real time and if you want to do that, simply click the “Run Automatically" box.
You can save the Workspace as a Dynamo file for later reuse.
A Simple Example
Figure 3: Changing an element’s color using C# versus using Dynamo
The code at the top of Figure 3 uses C# programming to tap the API to temporarily override the color of a selected wall element—in this case, red. In the bottom image, the C# code shows that same method using dynamo nodes. Which programming language do you prefer to work in? Yes—Dynamo is that simple.
There are so many applications of Dynamo I could not even begin to get into all of them within this article. Take comfort in knowing that Dynamo is a handy toolset for any Revit user. Dynamo is easy to use and could be applied on a daily basis. Dynamo is useful for everyday practical tasks such as setting family parameters equal to each other from one family to another or exporting and importing data via Excel. Dynamo is ever-evolving so now is the time to download load it and learn it. Why wait? It’s free! By the way, Dynamo could also be used to create an elephant in Revit as shown in Figure 4.
Figure 4: The Revit Elephant, built using Dynamo