Visibility Toggle Formula

Visibility Toggle Formula

DrakeCanyonArchitecture
Collaborator Collaborator
3,925 Views
8 Replies
Message 1 of 9

Visibility Toggle Formula

DrakeCanyonArchitecture
Collaborator
Collaborator

How do you write a formula for "if this condition is true, and this condition is not true, result"?

I have 4 check boxes If I check box 1 and box 2, box 3 is checked (my formula for box 3 is "if(and(box 1, box 2), 1 = 1, 1 = 0) and box 4 is unchecked. Now I want, "if box 1 is checked and box 2 is not, box 3 unchecks (which is handled by the formula for box 3) and box 4 is checked.

In the simplest terms, box 1 and box 2 toggle 3 and 4. 

And 1 more description of what the actual result in the family will be. I have 2 items, neither are visible until I check box 1, then only one appears. Checking box 2 turns the first item off and turns the second item on.

Kevin Mendenhall
Revit Architecture 2022
Microsoft Windows 11 Professional
Dell Precision 5870 - x64 based PC - Intel Xeon CPU @ 3.80GHz, 6 Core. 80Gb RAM
Installed Add Ins - Enscape/StrucSoft MWF/LotSpec
0 Likes
Accepted solutions (1)
3,926 Views
8 Replies
Replies (8)
Message 2 of 9

martijn_pater
Advisor
Advisor
Accepted solution

No need for the IF statement, just AND(box 1, box 2), and I guess AND(box 1, NOT(box 2))...


Message 3 of 9

DrakeCanyonArchitecture
Collaborator
Collaborator

Man! Thank you @martijn_pater ! I'm trying to learn all I can about writing formulas but it seems like it's hit and miss, kinda learning as I go. I appreciate the help!

Kevin Mendenhall
Revit Architecture 2022
Microsoft Windows 11 Professional
Dell Precision 5870 - x64 based PC - Intel Xeon CPU @ 3.80GHz, 6 Core. 80Gb RAM
Installed Add Ins - Enscape/StrucSoft MWF/LotSpec
0 Likes
Message 5 of 9

klutzEGX59
Observer
Observer

I used this formula to show only one graphic element in a family that has four elements. It allowed me to select one check box and it would automatically uncheck the visibility boxes of the other 3 elements.  This is the goal, however in order to cycle through the elements I would then uncheck the first box and check the next box. Ideally I would like this to be a single action where checking the desired box would uncheck the previously selected box.  The attached images show how it is currently configured.

 

I appreciate any insight available.

0 Likes
Message 6 of 9

ToanDN
Consultant
Consultant

@klutzEGX59 wrote:

I used this formula to show only one graphic element in a family that has four elements. It allowed me to select one check box and it would automatically uncheck the visibility boxes of the other 3 elements.  This is the goal, however in order to cycle through the elements I would then uncheck the first box and check the next box. Ideally I would like this to be a single action where checking the desired box would uncheck the previously selected box.  The attached images show how it is currently configured.

 

I appreciate any insight available.


If they are nested families then you can create a selector label <Family Type parameter> and select one of the types from a dropdown list.  If they are modeled in the same family then you can associate the yes/no box to a Integer parameter, i.e. enter 1 to the integer parameter to check element 1 box, 3 for element 3 box, etc...

Message 7 of 9

Martijn.Pater
Advocate
Advocate

You can inverse toggle between two yes/no parameters - a and b- by applying the formula not(a) to b for example, this will toggle b off when a is turned on and vice versa. For multiple yes/no parameters you might use some sort of and/or statements with that such as not(or(a,c)), but then you can still have a+c on while only controlling parameter b. So if you need to control all of those using a single input you will need a seperate integer input to drive all of them, as @ToanDN mentioned above.

MartijnPater_0-1626941954348.png


fiy also: no if statements needed for yes/no parameters, for instance if(int=1, 1=1,1=0) does the same as the condition itself as shown above.

Message 8 of 9

klutzEGX59
Observer
Observer

Thanks for your response @ToanDN !

I was able to use the integer parameter as you described and gain a degree of function closer to what I'm looking for. Formula is so much easier than the "NOT" statements I started with and very easy to work with. Ultimately, I want to get to the dropdown list option. I'm working on this now.

0 Likes
Message 9 of 9

klutzEGX59
Observer
Observer
Thanks for your additional input. Sounds a little complex, but I think I'm following your logic.
0 Likes