Revit 2021 – Use For Loops and If Loops in Dynamo Python


Using Dynamo and Revit together is great. Most of the tasks are relatively easily managed. However, sometimes, someone who has dabbled with programming longs for the compact way in which one can manipulate data in code. It helps keep the Dynamo script easy to read as opposed to trying to interpret the spaghetti of applying logic using Dynamo nodes and their connections.

In this video we have a quick look at how we use FOR and IF loops to cycle through elements that we gather from Dynamo. We see how we can index a counter to the elements that are selected. We also see how we can use conditional statements as triggers to perform an operation on data. The nice thing about coding is that, unless one is doing applied mathematics with geometry, all one needs is a bit of logic to get the ball rolling.

If you need help adopting Revit, BIM, and Dynamo in your practice, please contact Micrographics so we may be of assistance.