Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Yes/no parameters and if statements

From: Revit Families Workshop

Video: Yes/no parameters and if statements

In this lesson, we're going to add an If statement, and a Yes, No statement to our family. There's a lot of what ifs to consider when creating a family. What if, we want to give the user a choice to add a quarter inch panel to the back of the Wayne's Coat. But if we give this choice, we need to make our styles magically go from three quarters of an inch, to a half inch. While keeping our rails at a consistent three quarter of an inch. We can do just that. The objective of this exercise is to create a yes, no Parameter. And then use an if statement to control the dimension of our styles. To get started, Open your family called Styles and Rails, and follow along. So essentially, if you see here under Graphics.

Yes/no parameters and if statements

In this lesson, we're going to add an If statement, and a Yes, No statement to our family. There's a lot of what ifs to consider when creating a family. What if, we want to give the user a choice to add a quarter inch panel to the back of the Wayne's Coat. But if we give this choice, we need to make our styles magically go from three quarters of an inch, to a half inch. While keeping our rails at a consistent three quarter of an inch. We can do just that. The objective of this exercise is to create a yes, no Parameter. And then use an if statement to control the dimension of our styles. To get started, Open your family called Styles and Rails, and follow along. So essentially, if you see here under Graphics.

I have a new parameter called Style Thickness and I move my back panel graphic up. So essentially, we start an end statement if, back panel, meaning if back panel's yes, then a half inch, with a comma. If not, three quarters of an inch. It's a pretty simple expression. So let's get started on it. In the Properties panel, I'm going to click my Family Types button. Under Parameters, I'm going to click Add. The parameter I'm going to add can be called Back panel.

(audio playing) It's going to be an instance parameter. The type of parameter is going to be yes, no. Let's group to parameter, under Graphics, and hit OK. Notice it's just a button. Let's find Style Thickness under Dimensions, and for parameters, click Modify. Let's group that under Graphics as well just to keep the two together. Click OK. Now it's time for our if statement.

So to start and if statement we start with the word if, and immediately we need to follow it with an Open Parenthesis. The next thing we type is the actual parameter that we're trying to control. That parameter is Back panel. So if back panel, is yes, meaning if back panel is checked, we need to throw in a comma, and give it a value, one half inch. If we have a back panel in there. Our style thickness is going to be a half inch.

If it's unchecked, we need to throw in a comma, and type in what we want if it's unchecked. And it's going to be three quarters of an inch. We need to close our parenthesis. So let's read it again. If, Back panel is checked, then I want my style thickness to be a half inch. If it's unchecked, I want it to be three-quarters of an inch. Hit Enter, uncheck Back panel, and it works. Let's turn Back panel on, or check it on and click Apply.

Let's click OK. Now let's add a back panel. We'll do that by going to the left elevation. Let's add a quarter inch reference plane. And Create, let's click Reference Plane. Let's offset one quarter inch. Use our Pick Lines button and let's offset up one quarter inch. Let's dimension it and this time, let's lock the dimension. I don't want a variable, that's fine.

Now what we're going to do is extrude a panel straight down. Go to the Create tab, go to Extrusion. On the Draw panel, let's use Pick Lines. Make sure your Lock button is checked on. So we're going to grab this guy, this guy, this guy and this girl. Hit Escape a couple of times. On the Modify panel, let's click, Trim Extend to Corner.

We're just happily drafting. (audio playing) Nice, hit Escape a couple of times. On the mode panel, click Finish Edit mode. Let's go to ref level floor plan. Let's click the Align button on the Modify panel. Let's click this Reference Plane.

Let's select our panel, make sure you lock it. Hit Escape a couple of times. Let's go to a 3D view. Let's swing around and look at our panel. It's in there. So, let's add two material variables. Go ahead and select this extrusion here. Now let's scroll down to Materials. Instead of by category, we're going to add a parameter. So click on Add Parameter here, let's call it Frame Material. Might as well keep it in Instance Parameter.

Everything else looks good, hit OK. Hit OK. Click the Style and hit a Type. For Material, click on this button here and grab Frame Material and hit OK. Because it's a Type parameter, all of our styles are going to have that material. Click Apply, click OK. Select your panel. There's a couple things I want to do with this. For Visible, click this little button here and put it on Back panel.

So that has two functions. If that thing's clicked off, that Back panel disappears. And this style becomes three quarters of an inch to fill that void. Click OK. Let's scroll down the Material, click this button. Let's Add a Parameter. Type in panel Material, Instance parameter, let's hit OK, OK. Not bad, if you still have your project open with the wall in it, great. If not go to the Purple R, go to New Project, use the Architectural template. And draw another wall in there like we did before. If you have the project open, let's just click Load Into Project. And if you do have it open, you're going to get this dialog. Overwrite the existing version.

Let's scroll in on this guy, let's go a head and check our panel, change some stuff up. For the panel material, let's click the Builder button. Let's find my favorite Cherry, Select that. For shading let's use Render Appearance. For the surface pattern, I don't know, let's use wood three. Hit OK. For the cut pattern, we use wood one, click OK.

Hit OK. For the frame material, let's find a Walnut. (audio playing) Double-click on Walnut down here, select Walnut up here, use Render Appearance for shading, Surface Pattern. Let's make that Wood one, hit OK? Cut pattern, let's make that Wood one, hit OK. Hit OK.

So, now we take a look at some of these items. Let's keep our back panels turned on. Click Apply, click off of it. Let's set our visual style to Realistic. Well not too shabby, not too shabby at all. Let's test out one thing on the end here. Our panels are half inch, with the backer on it. If I select this and I uncheck Back panel, hit Apply. Yeah, that's pretty cool huh.

Now we're at the far end of creating families. Think about the possibilities of how we can automate our processes. In Revit, if you think it up it can be accomplished.

Show transcript

This video is part of

Image for Revit Families Workshop
Revit Families Workshop

21 video lessons · 3631 viewers

Eric Wing
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Revit Families Workshop.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.