This video will cover the most common nodes and techniques used to reference geometry and parameter data inside the Dynamo environment. We will begin by covering the methods of selecting Revit elements (a few at a time, then all elements of the same Category or Family Type), then extract the selected elements' Geometry data and Parameter data ready for use in Dynamo.
- [Voiceover] When you launch Dynamo for Revit, a common first step to analyzing or working with your project's Revit elements is to choose exactly which elements you're interested in bringing into the Dynamo environment. In this video, we'll cover some of the most common methods of selecting Revit elements for use in Dynamo, and when it's best to use each method. Let's begin by launching Dynamo under the Add-Ins tab in Revit. Let's go ahead and create a new home workspace. Now all of the nodes that we're going to use to select Revit elements, are found in the Revit Library under Selection.
The first method we'll cover is to select model elements one at a time by selecting them in a view. Let's drop in a Select Model Element node. The node that's dropped in indicates that we don't have anything selected yet, and that's why it's turning yellow. I'm going to set up my workspace so that Dynamo takes up half the screen and I can see Revit in the background. In order to select our element, we're going to click on the grey select button. Now Dynamo gives you the opportunity to go into Revit and select the element that you're interested in bringing into Dynamo.
I'm going to go ahead and click on this wall in the Revit project. Now you'll notice that the node turns grey, meaning it has all the information that it needs to run properly, and we also see an Element ID number below the select button. If we look at the node preview, you can see that we've selected a wall, and we also see that element's ID number. Anytime that you see a green, highlighted number in Dynamo, it's referring to a Revit element ID number. So we've now pointed Dynamo to one wall instance. If we wanted to select more than one Revit element at a time we could also use the Select Model Elements node.
These methods are best when you're using Dynamo on a fairly isolated portion of the project. Maybe just a couple elements in a room, or a specific view, rather than gathering geometry or data from all over the entire project. Also keep in mind that even though this node is titled Select Model Element, this node will also select view-specific 2-D items, like detail items and annotation symbols. We're not limited to just 3-D geometry. If we're interested in using this wall objects geometry in Dynamo, we need to use one more node called the Element Geometry Node. We can find that under Revit Elements, under the Element section of the library.
If we plug a Revit element into the Element input, you'll notice that we now have that particular wall objects geometry in our background 3-D preview. If you're using Revit 2016, you'll also see that there's a Dynamo preview within the Revit view as well. Let's take a look at the node preview for the element geometry node. You can see that we have a solid here, which means that you can take this solid and apply any of the functions that we covered in the geometry chapter of this course. Maybe you'll analyze things like its volume, or its centroid, or you could even extract points off its surface to place other families.
We're going to get to that in a few minutes. Let's hop back over to the Revit Selection section of the node library. We also have a few options for picking edges, faces, and points that already exist in our Revit project which can save a few steps in Dynamo if we don't need the entire elements geometry. Let's drop in the Select Point on Face node, to pick a single point in Revit to bring into Dynamo. This node looks and functions a lot like the Select Model Element node. I'm going to click on the grey select button, and then we could go into Revit and select whatever point we're interested in bringing in to Dynamo.
Once I make a selection, you might notice that a point appeared in the background 3-D preview. If we look at our node preview, you can see here that we have a Dynamo point object. We can also see that the point appeared in our Revit preview as well. So we've covered a couple of methods of how you can go about and hand-pick elements in your Revit project for bringing into Dynamo. But other times you might be interested in selecting all of a certain type of element in the entire project. If that's the case, the process of hand-picking these elements might be a little bit too tedious, and you might be concerned that you might have missed an element or two along the way.
After all, if one of the most attractive features of Dynamo is the ability to automate, why should you need to make all your selections manually? If that's the case, you'll be interested in nodes like All Elements of Category, and All Elements of Family Type. Let's drop one of each of those onto our workspace. In order to complete this selection, we actually need to plug in what category, or what family type, we're interested in selecting all the elements of. You can find those two nodes here. There's a Categories node, and a Family Types node.
Let's begin with the Categories node. If we click on the Categories pull-down, we can see a list of all of the different Revit categories. Some of these might not look too familiar to you, because we're actually tapping into the Revit API. In this particular case, let's say we want to select all of the elements that fall under the walls category. I'm going to select Walls. Now let's plug in our category into the All Elements of Category input. You'll notice here that Dynamo is providing a list of every single wall in the entire project. Again, we can tell that these are Revit elements because there's a green element ID next to each wall item.
Let's try the same thing with Family Types. If we click on the Family Types pull-down, we can see every single family type that's available in the Revit project. In this case, I'm going to click on Window_Single Standard which is the window family that I've been using in this project. Now I'll go ahead and plug in Family Type into All Elements of Family Type. If we take a look at our node preview, we can see a similar list of Revit elements. So now that we've gathered a list of Revit elements, let's look at how we can extract even more information about the elements that we've selected.
Let's start by extracting each family instances' locations. I'm going to navigate over to the Revit Family Instance section of the node library now, where we're going to find more nodes for interacting with individual Revit elements. I'm going to go ahead and drop in this Location node, which will generate a Point Object in Dynamo at the same location as each family's origin in Revit. When I plug in our Family Type elements into our Family Instance Location node, you can see in our background preview that Dynamo creates a point object at the location of every single window in the Revit project.
You could also see a purple point appear on each window in Revit, indicating that that's where its origin is. Looking at the node preview, you can see that these are a list of Dynamo points that we can go ahead and use in any way that we want to. Let's finish with one more node that's really helpful in gathering parameter information about our Revit families. We'll drop in a node that we'll find in the Element section of the library, called GetParameterValueByName. This node takes a list of elements I'll plug in the windows coming out of our Elements of Family Type, and report the values of whatever parameter we give it.
Let's say we want to use this node to extract the height of every single window of our project. We can go ahead and plug in the All Elements of Family Type node, which is all of the windows in our project, and we could provide a string input to indicate the name of the parameter whose values we're interested in reading. Back in Revit, I'm going to select one of these windows. Before I type height into our string and then plug it into the Get Parameter node, I want to make sure that I'm going to spell it and capitalize exactly as it is in Revit. I'm going to select one of these windows in Revit, and see how the word Height is spelled out.
Looks here like we have a capital H and lower-case for the rest. I'm going to match that exactly in our String node. Capital H e-i-g-h-t. Now I'll go ahead and plug that into our Parameter name input. If we look at our node preview, we can see the height parameter value for every single window in the entire project. We're not limited querying information about number parameters here. If we were to change the height parameter to say Mark, you can see that our node preview updates. Now we're looking at the Mark parameter values for every window in the project.
So now you've seen a couple different methods of selecting families in Revit, and pulling geometry and parameter information into the Dynamo environment.
- 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