Using Dynamo for MEP Design – Part 2

This is the second part of my article, originally published in the official magazine of Autodesk User Group International, AUGIWorld.

Link between terminals and the main duct.

To fully exploit Duct sizing capabilities in Revit, we generally need a fully connected network between the mechanical equipment and Air Terminals. But drawing every duct for the entire networks from source to terminal can be time consuming and not relevant in the early phase of a project, when architectural layout is subject to major changes.

A possibility is to use Dynamo to virtually link every terminal to a placeholder family that will collect and sum Airflows in a given area and send the sum to a placeholder family used to perform duct sizing calculations on the main branch.

figure7

Revit provide us the Connect the main duct to “M_Rectangular Duct Connector – Supply Air – Air Terminal”. This is a generic terminal that will simulate the rest of the terminals. We connect this generic terminal to our main branch, and use it to simulate the rest of the duct networks.

The following Dynamo definition sums airflows of the selected Air Terminal and pass the value in the Airflow parameter of the placeholder family. This placeholder family now simulate the airflow of all selected air terminals. Since this family is connected to the main duct networks, we can now perform duct sizing for the main branch, without having to model the entire duct layout.

figure8

A word of warning anyway, since this placeholder family is integrated into the system, flow sum for the duct system is multiplied by two, since Revit count both the airflow of every air terminal and the airflow coming from the placeholder family.

Dynamo File

From Specified Airflow to actual terminal Flow

Another example of the power of Dynamo come when linking Air terminal to their enclosing MEP Space. In this example, we will see how to retrieve the required airflow in a given MEP Space, and distribute this value on every air terminal enclosed in this space.

We start by finding all MEP Space, and retrieving their “Specified Supply Airflow”. We also get all Air terminals, and use the Space.IsInSpace node to find if a given terminal is in the space. We make sure to set up the lacing of this node to “Cross Product” in order to test every Air Terminal with every MEP Space. This give us multiple lists of true or false indicating whether a given Air Terminal is in the space. With the usual combination of List.AllIndiceOf and GetItemAtIndex, we find our air terminals grouped by their enclosing space. We count the number of these terminals in each group, and use this count and a division to get the specified airflow on each terminal. The List.OfRepetedItem give us an instance of this specified airflow by terminal. We finally apply these value to these terminals with the Element.SetParameterByValue.

figure9

As we update the Specified Airflow of each MEP Spaces, this value will be divided by the number of terminal in the space, and applied to the said terminals.

figure10

Dynamo File

Terminal Max Flow

Another application of Dynamo is the real-time checking for max values in a given terminal equipment. In this example, we will check whether the airflow of a given terminal is below is max value, and highlight in red when the airflow is above the max value. In some way, this is similar to the conditional formatting function in Excel, except we are doing it directly into Revit.

We start by finding all air terminal unit in Revit with the “All Elements Of Category” node. Using the GetParameterValueByName, we get the Airflow on each of these air terminal. Since the Maximum Airflow is a type parameter, we use the FamilyInstance.Type node to retrieve the family type, then use again the GetParameterValueByName to find the “Max Flow”.

We can now compare this two values, and use the List.FilterByBooleanMask to find all terminals where Airflow is above the Max Airflow.

figure11

The last step is to override the color of these terminals to override by color to highlight the results.

figure12

This fairly simple example showcase the possibilities of Dynamo combined with the proper Revit objects library.

Dynamo File

Conclusion

Through these five examples, we see how to use Dynamo to enhance your calculation powers in Revit. It is clear by now that Revit is far more than a modeling tool, and once combined with Dynamo, it opens a lot possibilities for mechanical engineers.
Finally, I want to give my deepest thanks to Andrew Duncan, from Arup, for its great Autodesk university courses, where I get most of my inspiration for these examples.

Using Dynamo for MEP Design – Part 1

This two parts post was originally published in the official magazine of Autodesk User Group International, AUGIWorld.

Most examples of Dynamo focus on computational design and complex geometries. Many see Dynamo as a tool for creating complex geometry, and consider it from an architectural perspective. But Dynamo can be the powerful ally of every trade, all along the project life. By harnessing the data manipulation capabilities of Dynamo, you can largely improve on the current calculation features of Revit, and create new workflow for designing directly in Revit.

Through five use cases, I will present you some ideas for using Dynamo for mechanical engineering.

I will assume that you are already familiar with the interface and have a general understanding of how Dynamo works. Most examples below can be realized with “out of the box” Dynamo nodes, but to shorten my graph, I will make use of the following packages:

I will also use my own package, DynamoMEP, to manipulate Rooms and Spaces. All these packages are of course freely available on the Dynamo Package Manager. If Dynamo doesn’t include a lot of functionalities around Room, Space and Mechanical Equipment, I use extensively the Package Manager to enhance these functionalities and create new workflows for mechanical engineers.

A final word, try these examples on small models before running them in production, and work in “Manual” mode, a few graph I will use are quite hungry for memory.

Link between Room and Spaces

Rooms and Spaces are essential for everything from room names and numbers to energy modeling. And before anything else, you have to retrieve any architectural room and convert it into an MEP Space to be able to work with it. You can of course use the “Place Spaces automatically” function of Revit, but this does not match exactly every architectural room with a MEP Space, and lack some basic functionalities. To improve on this, you can use a few Dynamo nodes to create a MEP Space for every room in a given linked file.

figure1
The procedure focus on retrieving every room from the architectural linked file (with the Element.GetFromLinkedFile) and using these rooms to create a matching space using the Space.ByPoint node from DynamoMEP.

figure2

You can also retrieve parameters values from these architectural rooms and paste them into your newly created Spaces using the Element.SetParameterByName node.

figure3

As rooms evolve in the architectural model, you will be able to recreate on the fly the corresponding Spaces. However, be careful not to duplicate an existing space.

Dynamo File

Link between Excel and Spaces

One of the most featured use of Dynamo is the link with Excel spreadsheets. Theses nodes link two of our most used design tools, Excel and Revit.

For the mechanical engineer, this provide the ability to add programmatic values directly in Revit Spaces. In the following example, I will show you how to load the specified airflow value from an Excel spreadsheet. I will make extensive use of Dynamo lists, and present some ways to manipulate them.

We start with a path to an Excel file, and use it to feed the Excel.ReadFromFile node. This node read line by line the content of our Excel file. We remove the first line, the header, with the List.RestOfItems node, and use the Transpose node to convert our list of Excel rows into a list of Excel columns. By now, each list in our Dynamo node represent an Excel column.

figure4

With the List.GetItemAtIndex, we retrieve a list containing all MEP Space number and a list with their associate airflow.

To feed the “Specified Supply Airflow” parameter of our modeled Spaces, we need match them with the Space number in our Excel spreadsheet. To do so, we start by retrieving them (All Element of Category node), and get their number (Element.GetParameterValueByName).

The node List.FirstItemOf give us the row number of each of these Space Number in our Excel file. For each of our existing MEP Space in our model, we can now get the corresponding row in Excel.

figure5

Using the List.GetItemAtIndex, we get the required Airflow value in the Excel Spreadsheet. Before pasting them into Revit with the Element.SetParameterByName, we convert them to cubic foot, since Dynamo always work in Feet.

figure6

The entire business of retrieving values from Excel spreadsheet is generally only a matter of list, and nodes like Transpose, GetItemAtInded and FirstIndexOf are quite useful here. If this example only cover the specified airflow, it can of course be extended to every kind of data sorted in an Excel spreadsheet.

Just make sure that your MEP Space numbers match between your Excel file and your Revit model, since any discrepancy will make the FirstIndexOf fail.

Dynamo File

Next week, stay tuned for the second part of this post, where all secrets of airflow and terminals will be revealed.