Join Paul F. Aubin for an in-depth discussion in this video Creating hidden parameters in family content, part of Revit: Tips, Tricks, and Troubleshooting.
- [Voiceover] In this movie, I'm going to talk about a special little procedure you can do to create a custom parameter that is hidden from your users. So why might you want to do this? Well, when you're building family content, sometimes you create parameters that have the purpose of driving other geometry or checking for errors and correcting them before they break the family, and you might not want the users to fiddle with those parameters or their values at all. So if that's the case, you can actually create a parameter that's invisible. It will show up in the family editor, but then when you load it into a project, it won't appear.
So I'm going to demonstrate that by editing this conference table family that you see right here. Now this conference table family is using an array to determine how many chairs you have on each side. If I go to the type selector and I choose a different size, it resizes the length of the table and it changes the quantity of chairs. Right? So that works pretty well, but there's going to be some point within this family where you could input a value that will break because the quantity of chairs will violate the rules that are in the family.
So what I mean by that is, let me go ahead and edit the family here, and then I'm going to go to the Ref Level Floor Plan view. So what I mean by that is is that these chairs are using an array. So you select an element, you click the Array tool, and then you set it up as a parametric array, and then what happens is it puts a group around each item. You can see all of these items are group, and then if you move your mouse around, there it is, you can find a dimension that is associated with that array.
So this is the actual array element, and you can even label that with a parameter, which is what's been done right here. So that parameter is called Number Of Chairs, One Side. So what's happening is, when the family flexes, go to Family Types, and you choose a different size, it actually changes the quantity of chairs, and it will change the array. And that's going to work great as long as the array has two or more elements.
As soon as you try and go to fewer than two elements, the array with fail. So when would that occur? Well this particularly quantity is actually being determined by a formula, so it's taking the overall length of the family, which at the moment is 12 feet, subtracting two, for 10 feet, and then dividing that by two, which is where I'm getting this quantity five. Now if you set this number small enough, then when it does that calculation, it will yield the value of one. So at five, you're okay, you're at two, but if you go less than five, it's going to fail and generate a value of one, and if I tried to apply that, I'll get an error message saying that that parameter has an invalid value.
So let me cancel out of all of that, and that's the problem we want to try and prevent. So I don't my users to be able to put in an invalid quantity for the array, so we can do a simple formula that says, hey, if somebody tries to put in fewer than two, force it to be two, otherwise, go ahead and let them put in any number they want. But before we can get to that formula, we've got to create the custom parameter, and this parameter I'm going to create as an invisible parameter, so that my user doesn't even know it's there.
So I'm kind of checking for them for their own good, but I'm not even going to let them see that I'm doing that. All right, so there's a couple steps in setting that up. The first step is you have to create a shared parameter. Now a shared parameter, as its name implies, is a parameter that can be shared by one or more families or one or more project. So the parameter's actually stored in a separate, external file. That file is typically put up on a network server, so that everybody can have access to it, and then the definitions of the parameters are in that file and then any family or any project can pull parameters out of that shared parameter file and use them and they're always going to be defined the same way, so that Revit will understand that it's the same shared parameter.
So it's a pretty powerful and important feature. So I'm going to click that and I don't currently have a shared parameter file available, so I'm going to create a new one, here, and I've got a name for it right there. And I'm just going to put it on my desktop, and I'll save the file. Now before I can add parameters, I have to have at least one group, so all of the parameters within the shared parameter file have to be stored in groups. So I'll just create a group here, and I'll just call this one Array, and then I can click New, and I'm going to call the actual parameter, Array Check.
Now the type of parameter has to be Integer, because the quantity of items in an array is a whole number, so that's an integer. So make sure it says Integer here. Then there's an optional value here to edit a tooltip, and I like this feature. So I'm just going to put in something like, This parameter's checking to see that the quantity is valid. Right? And you can put anything you want there, up to 256 characters. So I'll click OK. Now here's the most important part of the whole process.
I'm going to OK again to close the file. That writes the shared parameter. Before you use the shared parameter in your family, you have to go out of Revit and edit the shared parameter file to make it invisible. You can't make it invisible within Revit. Okay? It's not available within the interface. So I'm going to go out to my desktop here. My shared parameter file is there, but again, it would typically live on a network server. Okay? But I'm going to open that up, and you could see that it's just a text file.
Now best practice says, don't edit this file. In fact, it's not just best practice. Revit says, don't edit this file. Okay? It says, Do not edit this manually, but that's okay, you know, as long as you know what you're doing, you can make some edits here without causing too much trouble. Well, bottom line is, you do want to be very, very careful here, but we're going to make one small modification that we're going to be able to get away with. Right next to this piece of text here, that's the description you put in, there's this number one right here.
That number one is designating whether or not this parameter is visible. If it's set to one, the parameter is visible. If it's set to zero, the parameter will be invisible. So I'm just simply going to change that one to a zero, close the file, and save the changes. Now I'm going to go back to Revit and add that parameter to this file. So now I'll select this chair element. It doesn't matter which one, and look around for that dimension.
So I'm going to select that dimension right there, and it's currently assigned to the number of chairs parameter. I'm going to go up to Label, add a parameter, and this time, instead of typing in what I want for the parameter, I'm going to click the Shared Parameter option and then click Select. That will go to my shared parameter file and any shared parameters that are available will be listed here. I only have the one called Array Check, and it will fill in everything else for me. And you see it's all grayed out there.
Now this particular parameter was a type parameter, so I'm going to keep this one also as a type parameter and click OK. And then I'm going to find the same parameter here, for the second group of chairs, and label it with the same one, Array Check. So so far, all I've done is just taken those two dimensions and swapped them out to a different parameter. Now I'm going to go to Family Types to complete the process. The chairs on one side, I'm going to select that name there, and do Control-C to put it on my clipboard.
Then in the Array Check field, I'm going to use an If statement. Now the way an If statement works is you say If, and then you say what you want it to look at, and it's a true/false kind of question. So if the answer is yes, do this. If the answer is no, do that. So I'm going to write if, open parentheses, Control-V. So that's the number of chairs parameter that I just copied to my clipboard. If that is less than two. Okay? So that's the question.
Comma, what do I want to do about it? Make it two. Otherwise, comma, go ahead and put in the number of chairs per side, close parentheses. Let me expand this so you can see the entire formula. It's a pretty simple one. But we're saying, if the number of chairs is less than two, force it to be two. Otherwise, go ahead and use the number of chairs. So, right now, this is five, so this happily complies and does five, but if I click up here in the length and I put in four, the calculation comes up with a value of one, but the array check is saying, well, you can't do one, it's gotta be two.
Okay? And it will force it to stay two. So that is pretty much all there is to it. Now what we really want to see is that the Array Check parameter is only visible here in the family editor. So I'm going to click okay, and then I'm going to load this family back into my project, and I'm going to overwrite the existing version. All right. Now I select the table and chairs, click Edit Type, and if you look over here, you could see Construction.
There's Number of Chairs, and then down here, under Other, is Number of Chairs, One Side, but notice that the Array Check parameter does not appear here anywhere in the list. So my user doesn't even know that that parameter exists, and once again, even if they were to put in a value that would normally cause an error, when you scroll down here, it says one, but it won't actually use a value of one, it would still use a value of two. Now it turns out that two chairs in a four foot table is a little too close together, but that's another kind of a problem.
So, anyway, that's how you can create an invisible parameter to sort of hide a calculating parameter behind the scenes, so that it doesn't distract the users, or they don't inadvertently mess with it, and it can be a way of adding that extra level of sophistication to your family content.
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.