Join Paul F. Aubin for an in-depth discussion in this video Customize shared parameters, part of Revit: Tips, Tricks, and Troubleshooting.
- [Instructor] In the previous tip, we looked at how to create this custom shower stall family here that had a user-selectable choice to allow the shower head to either be on the left, right, or center. I've got a version of that family right here and it's loaded into a project. If I select it, the shower head location parameter is right here. And this is the dropdown list; Left, Right, or Center. When I make my choice, it changes where the shower head is mounted. If you watched that tip, then you know that the way that that was achieved, was by using a series of special parameters down in the other grouping.
A series of checkboxes and a series of family type parameters that are used in formulas to decide which shower head to show. It all works very well until a curious user scrolls down here and says, "Gee, I wonder what these parameters do." Even if they happen to hover over the parameter and see the message that says, "Do not edit this parameter," they might still find themselves curious and go, "Hmm, I wonder." Then, they suddenly end up with an extra shower head. Or they might change these values in such a way that they end up with no shower head, or some other behavior.
The important thing here is that in order for the formulas that we built into this family to function properly, it's really critical that these value remain consistent. What I'd like to talk about here in this video is two approaches that we can take to help ensure that. Both of them will involve the use of shared parameters. If you're not familiar with a shared parameter, shared parameter is just a parameter that's defined external to your Revit project in a separate TXT file.
That TXT file usually lives up on the server. There's usually one for the entire office and it contains a whole list of shared parameters that are used by any project or any family. For this example, I've provided a sample shared parameter file. I'd like you to just load that up for this example and then when we're done, you can just go back and swap back in your office standard parameter file. To get started, let's go ahead and start by loading that shared parameter file. I'll click on the Shared Parameter button that will display the Edit Shared Parameters dialog.
I'll click Browse here. Browse to my Exercise Files and select this file that I've provided called Customize Shared Parameters, and click Open. When we load that file, there's a single parameter group called Invisible and it contains actually two kinds of parameters, invisible parameters and non-modifiable parameters. Both of these are user-defined edits that we can make to shared parameters to customize the way they behave. I've already created five of the six that we want to have here.
Let's create the last one together. I'll click the New Parameter button over here on the right and I will create the missing invisible parameter which is going to be called INV_SH for shower head, and Center. The Type of Parameter is a family type parameter. The Category for that parameter is Detail Items. As far as the tooltip goes, you could edit that and put in a note about this parameter.
I'm going to click OK there, and that creates the parameter. Let's OK again to close the dialog. It's very important that you do the next step before you load the shared parameters into the family. Once the shared parameter exist in the family, the next step that we're about to do would no longer work. So it's critical that you define it properly first and then create a new parameter from it in the family. What am I talking about exactly? Well, the edit that we're going to make, we're going to do external to Revit.
We're going to go to our Exercise Files folder. We're going to select that TXT file and right-click and choose Edit. That will launch Windows Notepad and we can simply edit the file here because this is just a basic text file. The thing is, if you look at the top of this, it says, "Do not edit this manually." He's pretty serious about it. That is true for most of the fields within a shared parameter file.
In other words, if you scan across the top here, these headings tell you the names of each field. You don't want to edit the PARAM, the GUID, the NAME, the DATATYPE, DATACATEGORY, or the GROUP. None of these. Just leave all those alone. If you edit them, you are liable to break this file and it will no longer function properly, so please make a backup before you continue. However, VISIBLE, DESCRIPTION, and USERMODIFIABLE, the last three columns, you can edit pretty safely right here in this file without any fear of causing anything bad to happen.
VISIBLE is the third column over and USERMODIFIABLE is the final column. Notice that currently, they're all set to one. These are all just toggle switches. They're either on or they're off. Looking at the names, I'm in the habit of including INV for parameters that I want to make invisible and NoMod for ones that I want to not be modifiable. What I'm going to do is just looking at the names here, I'm going to come over here to the appropriate column and change the ones to zeroes for anything that I want to toggle the other way.
For the first parameter, that's an invisible one, so I'll toggle off visibility. I'll do that for this one and this one as well. The remaining three are the NoMod ones, so I'll scroll over here and that means the second and third one are not modifiable and this second to the last one here is also not modifiable. Just double-check that I've got all that correct. If you want, you can edit the descriptions as well and then close the Notepad file and save it.
Again, it's always a good idea to have a backup just in case. Back here in Revit, I'll select the family, edit the family. Now, I want to replace the parameters that are used here in family types for these three with the ones in the shared parameter file. Let's start with the non-modifiable versions first. I'll select the first one there, the center parameter, edit it, and swap it out with the shared parameter. You click Select, and then I'll chose the NoMod Center one, OK, and OK again.
Notice that the minute you choose that parameter, it does two things. It changes the name, so it now says NoMod so you know that you've done it, and it grays it out. You already can't modify this. Make sure that you've set the values the way you want first before you replace them with shared parameters. Let's do it again. At this point, you already can see the behavior that you're going to get when you use the non-modifiable parameters. If we click OK and we load this back into our project, then what will happen is on the Properties palette, we'll override it.
Then when we select it down here on the Properties palette, you'll still see these parameters listed but they're going to be grayed out so there's no chance that the user can accidentally modify them. I've gone ahead and added a tooltip to just kind of let people know why that's the case. If I edit this family a second time and if I want to try the invisible versions instead, then it's the same exact process. Scroll down, click here, edit it. Shared parameter, Select. This time I'll pick the invisible version.
That releases the value, it's no longer non-modifiable so it makes it easier for me to edit here in family editor. But now the experience will look like this when I load it into the project, override the existing, select it. Scroll down, those three parameters disappear altogether. From the user's point of view, they don't even know they're there. It really just depends on which way you'd like to manage those special parameters that are driving data.
If you want to leave them there so that it's discoverable by the user and they just can't mess with it, make them non-modifiable. If you don't want them to even know they're there, they don't need to know that, keep it clean and lean and not have a bunch of extra parameters showing up, you can make them invisible. You can even do both if you wanted to, but to me, it seems like you really ought to do one or the other. Anyway, those are a couple techniques that you can do to make these formula-driven parameters a little bit more stable and a little bit less susceptible to either accidental or deliberate editing by the end user.
The only caution is, you are editing the shared parameter file, so do so with caution. Make sure you do a backup. By the way at the end of this exercise, you might want to reload your office standard shared parameter file again and throw away the sample one that I've provided.
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.