Join Paul F. Aubin for an in-depth discussion in this video Drive family parameters with a dropdown list, part of Revit: Tips, Tricks, and Troubleshooting.
- [Instructor] When creating content, I often find myself in a situation where I'd like to be able to provide a list of choices for the end user to be able to select from. So there's a process that we can follow to make that happen. It's a fairly lengthy process, and so I want to demonstrate that here with this very simple shower family that I have here on screen. So I've got a 3D view on the left, and I've got a plan view on the right, and I've just simply tiled those, and I've got this single shower head currently inserted in the file. I'll click over here in the floor plan view, select that shower head, and I'll click Create Similar.
That'll bring in another instance of the shower head. I'll tap the Spacebar to rotate it 90 degrees. Place it over her on the left. Tap the Spacebar twice more to rotate it around again, and place it over here on the right. Click the Modify tool to cancel the command, and then I want to make sure that those don't move when we flex the family, so I'll use my align command. Use the left reference plane over here, and align that to the back of the shower head, and lock it. The right reference plane here, back of the shower head and lock it. The center reference plane here, align that to the center of the shower head, and then one more time center reference plane, center of the shower head and lock it.
So now I have the three shower heads positioned and locked to their correct locations, but now I want to make sure that I only can ever see one of these at any given time. So I'll select the one here on the left, and then over here on the properties pallet there's a visibility check box right here, and next to that we can associate a family parameter to that visibility setting. So let's click that, and I don't currently have any yes no parameters for this purpose. So I'll come down here to the bottom, click New Parameter, and create a new parameter for this item.
Now I'm going to call that vis, V I S, for visibility, sh, shower head left. So this is the visibility for the left shower head. It'll be a yes no parameter, it's going to be grouped under other, and then I'll make it an instance parameter and click okay. Now I need to repeat that twice more. So once I've done that, I now have three check boxes controlling the visibility of each of the shower heads.
Now, if we go to family types and take a look at that, they're down here under the other grouping, and they all say the word default next to the names. This is because we made them instance parameters. Now, I chose to do it that way even though you could argue it might have been simpler to make them type parameters because then with a type parameter we could come up here, we could duplicate the type, and we could create a 48 by 36 center, and a 48 by 36 left, and 48 by 36 right, and then we could come down here and check the appropriate boxes and call it done.
That works, and if you want to do it that way, you are welcome to do so. I chose not to do it that way for two reasons. One, it's a lot of types. So for every size that I have in the list, I would need to actually have three versions of that size for left, right, and center, but the other reason is I think it's just a nicer solution for the user if they can choose the size based on the type and then select it and decide where they want the shower head to be installed separately. So by making the size type parameters in the shower head instillation an instance parameter, I kind of give that nicer experience to the end user.
Now, like I said, if you want to do it the other way you can, but then you don't need my workaround here. So let's keep going. Let's assume that you want to keep them instance parameters and do it the way that I'm suggesting. What do we need to do next? Well now we need something that will serve as the list. We need that list of the three options for installation. To do that, we're going to use a family type parameter. A family type parameter points to a family of a certain category. So to make this trick work, you need to create a new family, and you need to choose a category that you won't be using for anything else in your family.
So you can choose any category you want here as long as it's one that you won't be using for some other purpose. So in this case, to keep it somewhat generic and I know for sure I won't need it for anything else. I'm just going to choose a detail item family. Now again, the category you choose, really up to you. This is an empty detail item family. I'm going to keep it empty. I'm just going to do one thing. I'm going to save it, and I'm going to save this and call it left, click save, and then that's it.
I'll go up here, save as, call it right, and do it one more time and call it center. The center one is still open so let's load it into project and close. That will load it into my shower. It wants me to place it somewhere on screen. I don't even want to place it. I'll just press escape. It doesn't need to be inserted for the next step to work. It just needs to be loaded into the project.
Now where did it load exactly? Well if you look at your project browser here, under families we now have a detailed items branch, and if I expand it, we now have the center family loaded, but what about the other two? Well to load those, I'll go to the Insert tab, click Load Family, go out to the location where I saved those files, select both left and right, and open those as well. That will add those two to the list. So that's all I needed to do. I now have these three empty families loaded into this host family, and I can move on.
So let me come over here and do restore down. That'll return me to a tiled two window configuration here, and the next step will take place in the family types dialogue again. So back to create, back to family types, and now what I want to do is create a new parameter that looks at that list of detail items. So I'm going to call this shower head location. So this is the list that I'm creating now that my user will choose from. It's not a length parameter, so I'll open that up, and I'll change it to a family type parameter.
The family type parameter will display a list of all the categories. If I scroll down on the list, and locate detail items, and click okay, what is that going to do for me? Well a family type parameter looks at the current file, and it will make a list of all the loaded families in that category. So in this case, I'll get a list that contains left, right, and center. Exactly what I want. It's currently grouped into other. So I'm going to change that to a more user friendly grouping. Now you can really pick any grouping you want, but I'm going to pick construction.
That's higher up on the list, and I think it kind of fits, but really any grouping is fine here, and I'm going to make it an instance parameter. Now, if you want it to be clear to your user what they're supposed to use this parameter for, you can edit the tool tip, and you can type something in. Like choose the location for the shower head. When I click okay, under construction I'll now have a shower head location parameter. If you hover over it, the tool tip appears beneath it, and it now has a list of left, right, and center.
So we're getting there. We've got almost all the raw material we need, but there's still one more thing we need now. In order to link these two things together, we want that list up at the top to drive these check boxes down at the bottom. We actually need to create three more family type parameters. So back to New Parameter, and the first one I'll call shower head left, make it a family type, choose detail items, click okay. This time I'll leave it under other.
I still want it to be instance, and very important, we're not going to want our user to change this value. So I'm going to write some sort of a message here letting them know not to do that. So you'll see in a moment why that is. Let's click okay, and let's add two more of those. So we've created shower head center, left, and right now.
They're all detail items. They all generate the same list. They all defaulted to center. So now here's the most important part of this entire process. This one already says shower head center and it's set to center, so leave it alone. This one is shower head left. So I need to change it to left. This one says shower head right. I need to change it to right. This is the part we don't want the user to change, because if they do, it'll mess up the whole thing. So as long as they leave these alone, then what we need to do is whatever they select up here under construction, and I'm going to select this parameter name here, and do Control C to copy it to my clipboard.
You don't include the word default, just the name of the parameter. Scroll down. For each of the check boxes I want to run a comparison. So I'm going to say for the first check box here, visibility for center I'm going to type SH center equals Control V shower head location. Press enter. That will gray out the parameter and check the box. SH left for the next one, equals Control V. That one unchecks the box, and then finally SH right equals Control V.
That unchecks the box. So what each of these questions is doing. What each of these formulas is doing is just asking a simple yes no question. Does this parameter, SH center, equal shower head location? And if the answer is yes, it checks the box. How about this one? Does this parameter right here, SH left, equal shower head location? Answer is no, it unchecks the box, because shower head location is constant for all three of them. Only one of these boxes can ever be checked because only one of those values will be true, and that's why it's so important that the user doesn't change these values down here.
So anyway, let's click okay here, and test this out. We can do that right here in the family editor by clicking the Preview Visibility. Toggling it on. You'll get the preview visibility here. Let's go back to family types, and we've got center chosen as the default here. Let's try left. Let's try right, and as you can see, it's working quite well. So we now have the ability for our user to choose from a list of options, and have it change out what is displayed as a consequence of their choice.
Now, it's not a true list parameter, it's close. There's a lot of set up works well for three items. Maybe four or five items. If you start getting a lot of items, it's going to become cumbersome to set all this up, and a little more error prone to keep it all working properly. So a big wish list item for me is to have a true list parameter that could drive the values of other parameters. So I do hope we'll get that some day in the future in Revit. So if there's Autodesk folks watching this video, then please record my wish and give us a true list parameter, thank you.
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.