A common favorite feature among Dynamo users because it is extremely powerful and quite easy to learn, this video will introduce the process of using Dynamo to set a new value to Revit element parameters, and will distinguish the different process required for writing Type parameters versus Instance parameters.
- [Voiceover] Running this exercise file does a couple of things. First of all, it reads an Excel file that we used in a previous video. The Excel file contains information about the different types of retail shelf families that ultimately we're now placing into Revit. For this exercise in particular, let's read the width data and push it into a Revit family parameter. The other part of the exercise file is placing a series of these families into Revit. Let's go ahead and drop the node into the workspace that's going to allow us to update family parameters. That node is called SetParameterValueByName, and we can find it in the Revit elements element section of the node library.
We can see that this node takes three inputs. The first one is a list of Revit elements, which we have ready to go here. Let's plug our family instances into the element input. The next input we need to provide is the name of the Revit parameter that we're going to be updating. Dynamo takes a string here. Let's drop a string input node in. We'll begin by updating the width parameter. The last input is a list of values.
The list of values that we're interested in populating here come from index two of our list transpose node. I'm gonna use a GetItemAtIndex node to extract just that list of information. I'll plug in the number two as the index. Good, looks like we extracted the right list of information. Let's go ahead and plug that into our value input. Let's click run and see what happens in Revit. Looks like we have some geometry updates, but there seems to be a little problem. If I select one of these shelves, it looks like the width parameter is reading 18 feet.
We probably had 18 inches in mind. That's okay. We can just divide this value by 12 and push it back into Revit again. I'll drop in a division node and one more number node. We're interested in dividing each of these values by the number 12 to convert from feet to inches. I'll hit run and double-check our output. Excellent, that looks much better. I'll go ahead and plug this division node into our values input.
There we go. That looks much better. Now, let's try the same exercise for index three or the height parameter information. It's helpful that I group these nodes together. I can simply copy and paste another instance of that group. All I should need to do now is change the index from two to three, and we'll wanna change the string input of our parameter name to height instead of width. I'm gonna hit run and see if it works. There we go. Excellent. Varying heights for each family instance now too.
Now, let's try to change the shelf count parameter. Again, I'll copy paste one more instance of this group. Looks like the number of shelves is coming from index four. Let's rename that now. Before I hit run I'm also going to delete our division node. Because this is an integer parameter, we don't need to convert from feet to inches anymore.
Excellent. Our Revit geometry's updated again. Finally, let's try updating our depth parameter which, if you remember, is a type parameter. I'm gonna copy paste another one of our group instances. We're not pulling any information about the depths of these shelves in from Excel, so we'll just go ahead and use a number input to populate this parameter. Because we're not updating an instance parameter though, we do need to use one additional node. The problem here is that the parameter that we're trying to update isn't a parameter of the family instance. It's a parameter of the family type. What we need to do here is we need to ask each of these family instances what its type is.
If we navigate to the FamilyInstance section of the node library, we can drop in a node that asks each family instance what its type is. Because we're updating the family type, that's what we wanna plug in as the element input in the SetParameterByName node. We'll also wanna change the name of the parameter to depth. We can also do away with a couple nodes here. We're not reading from Excel, so we can get rid of this cluster.
To set the value of this parameter, I'm gonna drop in a number input node. For this example, let's plug in the number three just to see if it populates properly. Looks like it did. We've got some pretty deep shelves. Maybe more realistically, this would be a two or a one. Maybe we'll set it to two and run it again. So, as we've now seen, it's very easy to update Revit family parameter values using Dynamo. Even though the process is slightly different for instance and type parameters, the concepts and even the node that does the job is the same.
- Placing and connecting Dynamo nodes
- Understanding Dynamo's data types
- Performing math functions
- Creating number lists and text strings
- Writing data to an Excel spreadsheet
- Creating points, curves, surfaces, and solids
- Analyzing geometry
- Linking a Dynamo-driven SAT into Revit
- Placing Revit families with Dynamo
- Creating Revit views and sheets with Dynamo