IF/THEN Formula and "Yes/No" Parameter

IF/THEN Formula and "Yes/No" Parameter

clippincott-CL
Advocate Advocate
309,938 Views
57 Replies
Message 1 of 58

IF/THEN Formula and "Yes/No" Parameter

clippincott-CL
Advocate
Advocate
I have created two "Yes/No" parameters in a family and associated each of them with the visibility of a different symbol in the family. If one of these parameters is set to "Yes", I want the other set to automatically be set to "No", and vice/versa.

I was trying to achieve this by making a formula that basically says, IF X=Yes THEN Y=No but I don't know how to reference the values of "Yes" or "No" in my formula, Revit tells me that "Yes" and "No" are not valid family parameters. I also tried "True" and "False" but got the same result.

Any ideas as to how I can do this? Any suggestions will be appreciated.
0 Likes
Accepted solutions (3)
309,939 Views
57 Replies
Replies (57)
Message 41 of 58

ToanDN
Consultant
Consultant
Is it the same as V2 = not (V1)?
0 Likes
Message 42 of 58

Anonymous
Not applicable

Yes


@ToanDN wrote:
Is it the same as V2 = not (V1)?

 

0 Likes
Message 43 of 58

Anonymous
Not applicable

Thank you so much Mr. Schmid.

0 Likes
Message 44 of 58

iram.zamora
Explorer
Explorer

That's a great method,

 

But, Can you constrain the integer to a certain range of numbers, 

 

For example, you are just using from 1 to 5, but you can type 60, and nothing it's gonna happen, can you put a limit to it?

 

Thanks!

0 Likes
Message 45 of 58

ToanDN
Consultant
Consultant
You need two parameters, one for input and the other for cap the range.

Input_param (integer)
Output_param (integer), formula: if (Input param > 5, 5, Input_param)

Assign the Output_param to your target. When you enter 60 to the Input, you will get 5 as the result.
Message 46 of 58

indiana_j0nes
Collaborator
Collaborator

Hi,

Maybe someone can help me out here, this maybe something much simpler.

So, I have three parameters H, G and O.

These control visibility in a Room-Tag and at a time only one is active in each of three Room-Tag Family-Type.

So when H is Visible, G cannot be and the reverse, this I can achieve by a simple not(H) or not(G) formula.

 

But there are instances where neither H or G can be visible, how do I achieve that?

Cheers for your help. KStp.JPG 

Kunal Tuljaram Gaidhankar

EESignature

Message 47 of 58

fabiosato
Mentor
Mentor
Accepted solution

Hello,

 

To simplify this solution, I prefer to create an integer parameter and use one value for each situation, like:

1 - O

2 - H

3 - G

And you can insert this rule in the tooltip of the parameter.

Fábio Sato
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 48 of 58

Anonymous
Not applicable
Hello,
nice solution. thanks!
My question: Where can i find this syntax documented? (in the classic "Help Doc" of Revit i can't find this "not(x)" syntax) is there more kind of that?

thanks in advance.

Greetings
0 Likes
Message 49 of 58

ToanDN
Consultant
Consultant
Accepted solution
Message 50 of 58

Anonymous
Not applicable
Thank you!
Message 51 of 58

Anonymous
Not applicable
Was this solved?
0 Likes
Message 52 of 58

iainsavage
Mentor
Mentor
0 Likes
Message 53 of 58

CourtneyHarwell
Observer
Observer

Trying to set up parameters for a cabinet that if a certain pull type is displayed, the others automatically hide. What am I doing wrong? The current set up below is not working and it is still allowing for multiple options to be selected/displayed at once. (The shelf parameter is working as that is simple and only going between two options).

CourtneyHarwell_0-1660319012059.png

 

Message 54 of 58

ajinath
Community Visitor
Community Visitor
Hello,

I have same problem.
0 Likes
Message 55 of 58

stanford.r
Participant
Participant

Sometimes it is useful to use a if/then for a "Yes/No" Parameter. Simply use a true/false equation. For yes, 1=1 and for no 1=0.

Example:  if(var A, 1=1, 1=0)

It is more useful with if(and(a,b),true, false)
For example if two things need to be true to display or one thing needs to be true and the other false, just add "not".

if(and(a,not(b)),1=1, 1=0)

0 Likes
Message 56 of 58

dsalvagni
Enthusiast
Enthusiast

If I have a bunch of signs in a family and I want one to be on and the rest to automatically turn off how do I do it, what formula do I use.  for example I have 10 different signs in one family and I want to be able to select the instance parameter that I want to use and have all the other ones turn off.

0 Likes
Message 57 of 58

fabiosato
Mentor
Mentor

Hello,

 

In this case, I prefer to create an integer value and use each value to make on each family visible.

Family 1 - Integer =1

Family 2 - Integer =2

Fábio Sato
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 58 of 58

ThobaniM_SUTH
Explorer
Explorer

You can reference the values of yes and no in the if statement as 2>1 for yes and 1>2 for no. The structure is "if(<CONDITION>, RESULT-IF-TRUE, RESULTS IF FALSE>"

Found that in this YouTube video - https://www.youtube.com/watch?v=02jjT6yYYcs. Hope this helps anyone with the same issue. 

0 Likes