Introduction to Revit Dynamo: Your First Dynamo Program

You may already hear about Dynamo. Dynamo is visual programming for Revit. You can see so many excellent program examples on the internet. So awesome that makes Dynamo is often overrated.

Dynamo certainly can do great things, but you can also use it to do simple repetitive tasks. In this first tutorial, you will create a simple program.

Prerequisite

You have to be familiar with Revit and computer literate. You need to know how Revit works, the terminology, and how Revit elements behave.

Exploring the Problem

Revit allows you to create a furniture schedule. You can calculate how many furnitures in the project, you can count them on each level, but Revit doesn’t allow you to count how many furnitures in each room.

We will create a workaround and use Dynamo to solve this problem.

Open a file

Let’s open a sample file. In Revit, click File menu> Open> Sample Files.

Open file rac_basic_sample_project.rvt.

Creating a Furniture Schedule

Create a furniture schedule.

If you are not familiar with creating a Revit Schedule, please learn about it here first: Creating Schedule from Revit Model.

As you can see, Revit doesn’t have room field in the furniture schedule. Let’s add Mark field in our schedule.

The idea to identify the furniture location is by adding the room name in the Mark field.

Yes, you can change the mark value manually. However, you will quickly notice that it doesn’t work that easily. The bar chair in the kitchen is in an array group.

It means you need to edit the group before you can change the mark value. So let’s use Dynamo to change it.

Working with Dynamo

In Revit Ribbon> Manage tab> Visual Programming Panel> Dynamo.

In the start page, click new.

Placing the Nodes

As we discussed earlier, we want to fill the Mark parameter to a room name. We can change a parameter value in Revit families using SetParameterByName node. Let’s find the node.

Right-click your mouse in Dynamo workspace. Type setparameter in the search field. Dynamo will list the node in the search result. Click the search result.

Dynamo will place the node in the workspace. Let’s examine the node. The left side of the node is the required input. The right side of the node is the output.

You need to provide which elements to modify, what is the parameter name, then what is the value.

The String Nodes

Let’s start with the parameter’s name. Parameter’s name requires string input. Let’s find a string node.

Right-click your mouse in an empty area in the Dynamo workspace. Type string.

The search result will list several results. Find “String” and let your mouse pointer on it for a while. Confirm that the pop up shows that the node description is “Creates a string.” Click the node name.

With the same method, place another string node. The second string node is to define the value.

The Select Elements Node

The last node you need to add is the node that allows you to select elements. We need to tell Dynamo which furniture to modify.

Right-click on the empty area of the workspace, type Select Elements in the search field. Choose Select Model Elements. There are Select Model Element (singular) and Select Model Elements (plural). Because we want to change properties on multiple elements at once, we use Select Model Elements.

Connecting the Nodes

Now you have three nodes on the Dynamo workspace.

  1. Select Model Elements Node
  2. Two Strings Node
  3. Element.SetParameterByName

Connect the nodes using wires.

  1. Left-click the right side of Select model elements then click Element on Element.SetParameterByName
  2. String to Parameter by Name
  3. String to Value

Changing from Automatic to Manual Mode

By default, Dynamo runs automatically. Every change you make will affect the result immediately. You can see it says Automatic at the left bottom corner. Click it.

Switch it from Automatic to Manual.

Setting the Values

We have all the nodes set up and connected. Now it’s time to change the values to allow this program runs correctly.

  1. Change the string node value for parameterName to Mark. Remember that the parameter that we want to change is Mark.
  2. Change the string node value for value to Living Room.

Selecting Objects

In the select Model Elements node, click Select. Minimize or move the Dynamo Window so you can see the Revit floor plan. Select all furniture in the living room. Follow the red rectangle below as a guide.

Maximize the Dynamo window again. Now you can see the list of selected elements in that node.

Click Run button to execute this program.

Dynamo will say Run completed with warnings. We will cover this later.

Repeat the same steps to the furniture in the kitchen.

Review the Schedule

Now, let’s review our schedule. Notice that the Mark fields are filled with the room name.

Summary

We created a simple program with Dynamo. We change a parameter in Revit elements only using one node, and added three nodes to set the input. We will review this program later.

You can see that Dynamo is very simple, and you don’t need to know a programming language to create a simple program.