Revit If statement with yes/no parameter

Revit If statement with yes/no parameter

Anonymous
Not applicable
7,031 Views
8 Replies
Message 1 of 9

Revit If statement with yes/no parameter

Anonymous
Not applicable

Hey guys, I just can't seem to figure this one out! I am creating a framed opening that I would like to tie ADA Clearances to. Attached I have an image of what I currently have in the properties.  I have an approach type for Side 1 and Side 2. (Front Approach or Side Approach) For each of these options I have a different depth clearance. So below I have created a parameter for the depth of the ADA clearance depending on if it is a front or side approach.  I would like these depths to adjust automatically when you select the check box above. I am trying to figure out how to do an if statement here with my yes/no parameters above. With the formula I have in the image below I get the error "Improper use of boolean expression". How do I set this expression up properly?!? 

 

Thanks in advance! 🙂 

0 Likes
Accepted solutions (1)
7,032 Views
8 Replies
Replies (8)
Message 2 of 9

rodrigo.bezerra
Advisor
Advisor

Hi @Anonymous

 

At the start, Side 1 and Side 2 parameters, they both will be checked at the same time? If not, place a "not(parameter)" formula so unchecking one will automatically check the other. Then restart the "If" condition from that.

 

Here there are formulas that might give you a clue to fix that.

 

Regards

Rodrigo Bezerra

EESignature

0 Likes
Message 3 of 9

Anonymous
Not applicable

These could both be on, both off, or one on and one off.  (See attached image) I would like to control the depths of Side 1 and Side 2 seperately since you could have a side approach on one side and a front approach on the other. My goal is to have the Side 1 ADA Depth be 4'-0" if the Side 1 Front Approach is Checked, and the Side 1 ADA Depth to be 3'-6" if Side 1 Front Approach is unchecked. Same for Side 2.

0 Likes
Message 4 of 9

rodrigo.bezerra
Advisor
Advisor

I'm thinking about it here, and I'm concluding that is easier - if you'll have three or more configurations of usage - to just use visibility parameters for each clearence in each side of the opening.

 

"IF" will obligate you to constraint formula after formula... Maybe a parameter that will transform the checked box to a number... Then this number could be used in the statement...

 

Do you mind to upload the family so I can try it in lunch break?

Rodrigo Bezerra

EESignature

0 Likes
Message 5 of 9

Anonymous
Not applicable

ya sure!

0 Likes
Message 6 of 9

Anonymous
Not applicable
Accepted solution

@Anonymous I think it's just an error in the way you've written the statement out.

 

For an If yes/no condition, it should be written as such:

if(PARAMETERNAME, IFYES, IFNO)

 

You have if(Side 1 Front Approach=1,....)

When I typed in :

if(Side 1 Front Approach, 4', 3'  6")

It seemed to work properly.

 

 

Message 7 of 9

Anonymous
Not applicable

Perfect! I got it to work as well. I just wasn't sure how I was supposed to write that out. Thank you!

0 Likes
Message 8 of 9

Anonymous
Not applicable

I have to remind myself every time I write one. 🙂

0 Likes
Message 9 of 9

Anonymous
Not applicable

I have another one for you guys... I haven't done anything with formulas for awhile so as you can tell I am a little rusty! 😉

 

Attached I have an image of the properties dialog box.  At the Top I have created a "Text" parameter for the "Clearance Type" Then under "Data" I have 3 approach types, "Front Approach", "Hinge Side Approach", "Latch Side Approach". From what I have read online, it sounds like I should be able to type "Clearance Type=1" in the formula box for Front Approach. Then when I enter "1" into the "Clearance Type" it will automatically check the "Front Approach" box (2 for Hinge, 3 for Latch). But when I try this I get the error message "Improper use of boolean expressions." I can't seem to figure why I keep getting this. From what I can tell I am following what I have found online to accomplish this. 

 

Thanks again! 

0 Likes