Join Paul F. Aubin for an in-depth discussion in this video Place multiple elements with Dynamo, part of Revit: Tips, Tricks, and Troubleshooting.
- [Instructor] If you ever need to place lots of elements in a Revit file that are related to one another, then you certainly could do it manually. But in some cases, you might be able to actually put Dynamo on the task and help you do it a little bit more quickly and efficiently. Now, the example I'm going to demonstrate here, is creating a Library file that contains a bunch of wall types. So this is a pretty common thing that a lot of firms will have. If you've created a bunch of custom wall types, you like to put them in an environment that's easily accessible from your users. So you create one of these little Library files, and you place one instance of every wall.
User can open that up, take a look around, see which ones they like, and even copy and paste them into their projects. So in this example, I'm going to actually use Dynamo to create that Library file. So what I'm going to ask Dynamo to do is to look at my list of walls, right here, and gather them all up and place one of every one of these walls on-screen. Now, I'm just using a copy of the out-of-the-box template that comes with the Imperial installation of Revit, so there's nothing special about this file. I just saved it, Wall Warehouse, for this purpose.
So I've already got Dynamo running in the background, and I've already got the graph built. So what I'm going to do is run the graph in pieces so that we can see each group separately. So you can actually select any node, right-click it, and choose Freeze, and what you'll see is not only that node but any of the nodes downstream from it will get frozen, and therefore those pieces of the graph won't execute. So at the moment, I'm going to focus just on this group one here, which, as the label says, it's going to select all of the wall types in the project.
'Kay, so I'm doing that with really just three nodes. The Watch node is just so we can see the results. The first node is Element Types. Now, that's in the Revit Library, under Selection. And you can find Element Types right here. Also, All Elements of Type is also in this location in the Library. So what this one does is it gives you a drop-down list of all the various types within a Revit project, and I chose WallType. Then, it feeds into here, which is saying select all of them.
We're sending that to the Watch node, which will give us a nice, tidy list of all of the types. And we're also sending it to a List.Count, which is in the Core part of the Library, and that's just going to tell us how many we have. So when I run that, you're now going to see a complete list of all the wall types in the project, 27 of 'em here, and that's confirmed again right here, 27. Okay, so now I have a list of all of my wall types. What do I want to do with them? Well, I want to place them in the file, right? So just in real brief terms, this group is going to set up the spacing between the walls, this one's going to place the points where they're going to go, and this one's going to actually draw the Revit element.
So let's go through them one at a time. So I'll start by unfreezing this node. And then, I'll come over here, and Freeze this one next. So let me zoom in on the spacing between the walls. There's only two nodes here. I'm using a Number Slider, which you could you find in Core, and a Sequence, which is also in Core under List. And what I'm doing is, the Slider is just a nice, interactive way of determining what spacing I want between each wall when they get placed. 'Kay, so you can just drag that to a desirable spacing.
I'm taking the quantity from the selection of walls up above, and I'm feeding that into the amount of this Sequence. Now, the Sequence node just creates a sequence of numbers, starting at a number, adding an amount, or the quantity of items on the list, and then the space between each item on the list is the step amount. So the Slider, we're using to determine the step amount, how far apart each number on the list is going to be. The start value defaults to zero. So I was fine with that, so I didn't feed any new input into that.
If you want to start at some other value, you could feed in an input. And then, the amount, again, I want 27 because that's how many walls I have. So if I run this portion of the graph, that will give me a nice little list here. And you can see that it started at zero, and then it stepped by five. So we got zero, five, 10, 15, and so on. And that gives me a list of numbers. I'm taking that list of numbers and feeding it into the x-coordinate of two Point.ByCoordinates nodes. Now, you can find those in the Geometry portion of the Library.
So that's the x value of two different points, and then for the y values, I started one at zero and the other one at 15. And if we look at the 3D graphic preview in the background, you can see that that gives me a series of pairs of points. OKay, so the ones at zero and the ones at 15, marching down in the sequence. Now, I'm going to use this node. Unfreeze it. Let me come over here and Freeze this one next. This node will just connect the dots and create a series of lines between all of those points.
Now, why create lines? Well, if we slide over here to the final group in the graph, really, it's this node right here, which determined everything that I needed. So a lot of times when you're designing one of these graphs, what you want to do is start at the end and figure out what you're trying to create, and then look at the inputs and determine what you need to feed into it. And once you know what you need to feed into it, then you can go gather up those pieces as well. So the two most obvious things were the Start and the End level.
Well, I got both of those under Revit, under Selection, with Levels right here. And I'm just going from level one to level two. That's going to set the heights of the walls. This c input is actually curve. C is abbreviation for curve. And if you're not familiar with programmer slash mathematical terminology, curve doesn't always mean curvy. Curve just means any linear element. So to create a wall in Revit, you need to define the linear path of that wall. So that's why we drew the lines.
So in this case, our curves aren't curvy, they're linear, but that satisfies the need of this curve input. And then finally, for the wall types, which type of wall do I want to draw at each of those lines? Well, that just comes from our original list back here in group one. So we just take that list, the same list that we're seeing here in the Watch node, and we feed that into wallType. And then, this one, Element.Geometry, I'm actually going to Freeze that. That would actually create geometry in the Dynamo graph. But if I run it at this point and move this out of the way, that created all of the Revit walls.
And as you can see, it created one of every type of wall along those lines from those coordinates that we specified for the lines. Now, if you unfreeze this Geometry node and run it again, then what will happen is it will also create geometry back here in the Dynamo graph. Now, sometimes that could be nice, as a nice visual, but it can be expensive in terms of processing power. So only add the Element.Geometry node if you really need to see the graphic in your Dynamo graph.
If you can live without it and keep it frozen, it will speed up processing time. Now, if we go back to the Slider that we had over here, here's the nice thing about working with a Dynamo graph to do this. Let's say that I didn't like the spacing of these walls. I think they're a little too close together. I can just adjust the Slider and increase the spacing to some other value there, and then I can run it again. And it will just reprocess in the background, and it just pushes all those walls further apart to make it a little bit nicer spacing. So I'm using Dynamo here to do something repetitive that would otherwise be rather tedious for me to do manually, and that's one of the things that Dynamo really excels at.
So whether or not you need to create a warehouse file full of wall types or not, you know, that's just one example. But if you need to do some repetitive task that would otherwise be very slow and tedious to do manually, then you should be thinking about Dynamo as a possible solution.
NOTE: The exercise files for this course can only be opened in the most recent version of Revit (Revit 2017).
Skill Level Appropriate for all
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.