Join Paul F. Aubin for an in-depth discussion in this video Controlling the spacing of elements with global parameters, part of Revit: Tips, Tricks, and Troubleshooting.
- [Instructor] I have a collection of sinks here and it's a pretty common desire to want to take a collection of items, such as these sinks, and make them equally spaced, so it's pretty easy to do that. We've been able to do that for a long time in Revit using a dimension, so I will dimension the centers of each of these sinks. Place the dimension string, and we've been able to click the toggle equality for some time now and be able to get all of those elements equally spaced. Now that's very effective and it works pretty well. And all of the sinks are equal to one another, but what we don't know here is what the distance is to the end of the counter top on either side.
Using an equality dimension, you really can't achieve that. What I want to look at here is a compliment to our equality dimensions or in some cases even an alternative to them, and that is global parameters. Now global parameters is a feature that's available in Revit 2016 R2 or Revit 2017. So if you have one of these two versions, you'll be able to do this next trick. Now that I've got these sinks equally spaced, I'm going to use my Align command and just make sure they're centered on the countertop. So, I'm going to pick the center of the countertop here and the center of the middle sink here, and you'll see them redistribute and center themselves.
And I find it's just a little bit easier to create the parameters if you're not simultaneously creating them and flexing them. In other words, if I tried to apply the parameter at the end and adjust the length in one step, it often causes an error. So, get it positioned where you want it first, then label it, then you can flex it. It's usually gonna work a little better. So here's a dimension, and I'll pick up the center of this plumbing fixture, and then at the end, you wanna pay attention to what the tooltip says. Right now at the end of my tooltip it says Shape Handle.
And you can see that down on the status bar at the bottom of your screen as well. If you press the tab key, that'll change to Reference. So it's pretty important that you're dimensioning the reference here and not the shape handle. If you dimension the shape handle, it'll try and stretch the countertop, but if you dimension the reference, then it'll actually be the overall object instead. So let's do the same thing on the other end. And again, make sure it doesn't say Shape Handle. If it does, press tab. I've got Reference, and then I'll place that dimension.
Now, these two look the same right now, and you can probably label them together. In my experience, it's better to label them one at a time. So, let me select this dimension, and the label dimension will appear on the ribbon, and I'll click this small little icon here to create a new parameter, and I'll call this, End Offset. Click OK. A little pencil icon will appear next to it, indicating that that is now controlled by a global parameter.
I can select this dimension and now on the label dropdown, End Offset will appear, and I can simply choose it, and label that dimension with the same End Offset parameter. Now that little pencil icon that I pointed out is how you can get to the global parameters dialog, and then once you're in there, you can change this value to something else. I'll do one foot, so that we can see the change pretty dramatically. And let me click Apply and notice that now my end offset on each end is equal.
They're one foot and one foot, but because of the equality dimension in the middle, the sinks redistribute themselves equally along the length in that case. Now if you're satisfied with that behavior, you're done. There's nothing more you need to do. Let's go ahead and set this end offset to something a little more reasonable like perhaps one foot six, I'll click Apply again, and then let me click OK. We could stop there certainly if we were happy with the result. Another alternative is, what if I wanted this distance here and this distance here to be the same? Well right now that's eight inches, that's one foot one.
Now this is the same as this, this, and this, and this is the same as this, but they're not equal to one another. To make them equal to one another, I need to run some calculations, and I need to set up my dimensions a little bit differently. So the first thing I'm going to do is remove the dimension on the left hand side. So, I'm going to press the Delete key here, and when I do, I'll get a warning from Revit telling me that I'm deleting a dimension, is it okay to also unconstrain it, or do I want to keep the constraint? It's very important that you unconstrain it here, okay? So I wanna choose Unconstrain.
Otherwise, that global parameter is still controlling that distance, even though the dimension's not there. This dimension I want to remove the constraint, but keep the dimension. So don't delete that one, just simply toggle off the equality. And that removes the constraint, and now those sinks are free to move independently again. It turns out that one of the features of global parameters is, you can have a multi-segment dimension selected like I have here, go up to Create Parameter. Call this Sink Spacing, and click OK, and it now labeled every segment of that dimension with the same sink spacing parameter.
What that means is that now becomes an alternative to the equality. The trouble is, if I try and flex it right now, it'll sorta work, but when I put in a new value here and click Apply, it will generate a error on the end here because by changing the distance of the sinks, it's trying to flex the one at the end, and that's in conflict with the value we said we wanted at the end, and so anyway, you could remove the constraint, but we don't want to do that, so let's Cancel, and Cancel again.
So what we want to do instead is, we want to make sure that whenever this number flexes, this number flexes accordingly as well. And we can do that by running a calculation to help make that happen. So, we need two more parameters to help us achieve that. The first is we're going to dimension the size of one sink. So, I'm going to make sure it says Plumbing Fixture here, and Plumbing Fixture reference here, place it there, cancel, select it, create a new parameter, and call it Sink Width.
Click OK. So now there's the size of my sink. I also want to control the length of my countertop. Now rather than do that with a dimension, there's another alternative. When you select the countertop, scroll down, you'll see that next to many of the parameters there's these small little square buttons and if you hover over it, it's labeled Associate Global Parameter. So you can associate a global parameter with any of those values that have that small button next to it.
So I'll click the one next to Length, click this new parameter button down here. Call that Countertop Length, and in a moment I'm gonna need that in a formula, so I'm going to select that, Control + C to copy it to my clipboard, click OK, and OK again. If you've ever done this in the family editor, then you've seen this before. That grays out the value, puts a little equal sign on the associate button, and now you know that the length of this countertop is being driven by an associated parameter. Now, I could click the little pencil icon to get back to global parameters, but as an alternative you can go the Manage tab, and click the Global Parameters button here on the Settings panel.
Now, another similarity to the family editor is, you've got your parameters, your values, and then over here you have formulas. And formulas allow us to use parameters in calculations of other parameters. So we can kind of effectively link them together this way. So let's think about what we want to happen here. We've got five sinks. If I took the total length of sinks, so sink width times five, subtract that from the countertop length, that gives me the total negative space that's left over. But then I have one, two, three, four between the sinks, and one, two, at the end.
So if I take that negative space and divide it by six instead of five, that's gonna tell me how big each of these negative spaces needs to be. So, how do we write that formula in Revit terms? Well, we come over here to the sink spacing, and the first thing I want to do is open up some parentheses, Control + V to get the countertop length, I want to subtract from that another parentheses, Sink Width times five close parentheses. Then I'm going to close the parentheses again, so there's my initial calculation.
Take the total countertop length, subtract five times the sink width from it. That gives me the total negative space. Now, I'll take that total negative space and divide it by six. Now I'm going to put this entire thing in parentheses. So I'll press my home button here, and put parentheses right there. Now if you want to test that at least that part is working you can click somewhere else and watch it run the calculation, but don't click Apply yet because it's not quite right. But it is working. It's taking the total countertop, subtracting five times the sink width, then dividing that by six.
Well, what do we need to do to that? Well remember, we're going center to center. So right now we've got this distance from the edge of a sink to the edge of a sink, but we need to add back now half the width of a sink here and half the width of a sink here, or in other words, plus sink width. Now, make sure you're typing all of these values in exactly the way you typed them here 'cause these are case sensitive. Now when I click somewhere else, that'll recalculate again, and now it's a little bit more than two foot seven.
The end offset now is almost exactly the same formula. So I'm going to select everything that's in this field, Control + C, come up here and do Control + V. The only thing that's different about it is, if you consider what's going on at the end, we've got the negative space here, but then we only have half of the sink instead of a full sink. So, put parentheses around sink width, and divide it by two. Click somewhere else to run the calculation, and now at that end, it should be one foot nine.
And finally, I'll click Apply here and it will redistribute all the sinks. Now, if you want to check to make sure that it actually worked, click OK, do a dimension, from here to here, that's 11 and some change, dimension from here to here, that's also 11 and some change. So let me delete both of those dimensions because they might cause the constraints to fail, and let me come back and flex the countertop length. Let's try 12 feet. And when I click Apply, it will change the length of the countertop and it will automatically respace all of the sinks.
It's similar to using the equality, but the extra thing that this does that the equality does not do is it ensures that all of the spaces are equal to one another including the two gaps at both ends.
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.