I want to control the visibility of multi-pull objects with an if statement.
If A is visible B,C,D,E are not.
If B is visible A,C,D,E are not.
IF C is visible A,B,D,E are not.
IF D is visible A,B,C,E are not.
IF E is visible A,B,C,D are not.
What I have worked out so far I have
Error (Instance) Yes/No = ErrorCheck>0
Error Check (Instance) Integer (For adding the formula)
A (Instance)
B (Instance) and so on...
I have tried various and's and If's but it always comes back with errors. I am using the choose option idea but you are able to pick options that are not available.
Regards Kris
Solved! Go to Solution.
Solved by barthbradley. Go to Solution.
It's a bit complicated with if statements, but can be done with a workaround.
Make one integer parameter named "Option".
Then make the visibility parameters like this:
A = Option = 1
B = Option = 2
C= Option = 3
...and so on.
"=Option=x" should be in the formula field of the visibility parameters
If the user chooses Option 1, then only A is visible and so on.
Hi thanks for you reply.
I have been using that as a work around my issue is the user can input a value that does not have an option.
Regards Kris
The first issue you have here is that everything is depending on each other. So you will create a circular definition.
And because you need formulas for all values you will have no way to set a value.
A solution might be to add set values.
You then would have to determine what should happen if more than one value is chosen by modifying the formulas
A better solution might be to create different types. Then you can set the desired values as you wish. The user only has to choose the right type.
Louis
Please mention Revit version, especially when uploading Revit files.
FWIW: Another workflow that you might consider is through the use of Family Type Parameter associated to a Nested Family that has several Named Types, each representing a different Visibility State of the elements within it. For instance, type "A" in the nested family turns off the "B", "C", "D" and "E" elements; type "B" turns of the "A", "C", "D" and "E" elements, and so on. In the Host family, you would choose the Nested Type to use with the Host Type.
Sounds a little more complex than it is. Better to look at the attached file to understand what I'm describing. In file, just toggle the different Types that have been set up (e.g. "A", "B", "C", etc.)
For the option as integer to work, consider using the if statement as a yes/ no.
The Yes is 2>1
The No is 1>2
Example:
Consider Horizontal lite count for a window. Mullions will change in number
Parameter: Value: Formula
Lite count: # : Formula Blank
Visibility 3 Mullions: Value Blank: if (Lite Count 4, 2>1, 1>2)
Visibility 2 Mullions: Value Blank: if (Lite Count 3, 2>1, 1>2)
Visibility 1 Mullions: Value Blank: if (Lite Count 2, 2>1, 1>2)
Visibility 0 Mullions: Value Blank: if (Lite Count 1, 2>1, 1>2)
Note: For 0 Mullions, I place a visibility on an invisible line
Question:
I know that an if and statement is for two conditions to be true and an if or statement is one condition to be true. But what happens if you just have one condition, but two things were true. Such that if lite count is 1, then top Mullion and Bottom Mullion would show, if not no mullions will show.
Thus conclusion: Multiple Truths per Condition and vice versa Multiple Conditions per Truths. Revit can do the Multiple Conditions per Truths with the "If and statements" and "If no statements". But the Multiple Truths per condition does not work in Revit.... Unless can an embedded if be used?
My work around for the above
Originally, I just had 4 mullions, which included the Bottom, Mid, Center, and Top. (The mullion is a nested family) I aligned these mullions to levels which had included parameters for height. I had these Mullions on Visibility bottom, visibility Mid, visibility center, and visibility top. The dimension parameters include Height from bottom mullion to bottom frame, height from mid mullion to bottom frame, and height from top mullion to top frame.
But being that I cannot say if this condition is true, visibility bottom and visibility top, visibility nothing, I changed my method.
Thus, I consider using the If condition, true = yes, false = no.
If the Lite count had an integer number of 4, then 3 mullions would show
If the lite count had an integer number of 3, then 2 mullions would show
If the lite count had an integer number of 2, then 1 mullion would show
If the Lite count had an integer number of 1, then 0 mullions would show
For 0 mullions, I created a line with an invisible line weight and gave it the visibility of 0 Mullion.
Lastly, I copied mullions and gave them different visibilities, but they maintained alignment to the levels that will dictate the height within the frame. How that works: The center mullion got placed on ctrl visibility center mullion, The top, mid, and bottom mullions were placed on ctrl visibility 3 mullions. I copied the top and Bottom Mullion and placed on ctrl visibility 2 mullions. I copied the bottom mullion and placed it on ctrl visibility 3 mullions. just had 4 mullions, which included the Bottom, Mid, Center, and Top. (The mullion is a nested family) The dimension parameters include Height from bottom mullion to bottom frame, height from mid mullion to bottom frame, and height from top mullion to top frame.
Create a visibility for 2 Mullions
@crystal.nupsonS8SQU wrote:
For the option as integer to work, consider using the if statement as a yes/ no.
The Yes is 2>1
The No is 1>2
Example:
Consider Horizontal lite count for a window. Mullions will change in number
Parameter: Value: Formula
Lite count: # : Formula Blank
Visibility 3 Mullions: Value Blank: if (Lite Count 4, 2>1, 1>2)
Visibility 2 Mullions: Value Blank: if (Lite Count 3, 2>1, 1>2)
Visibility 1 Mullions: Value Blank: if (Lite Count 2, 2>1, 1>2)
Visibility 0 Mullions: Value Blank: if (Lite Count 1, 2>1, 1>2)
Note: For 0 Mullions, I place a visibility on an invisible line
You can simplify your formula a lot more by replacing the red above with the blue below:
Lite Count 4
Lite Count 3
Lite Count 2
Lite Count 1
Hi sir
I tried to get that formula but i can't attach between set A and A parameter
Can you kindly tell me how to get that.
Another Question please.
Is that formula in 'other' section or in 'visibility' section
Hi, I'm hijacking this thread as I think I need help in the same area.
I'm creating kitchen cabinets and this one I've made with three different options for where the handle should sit, left, right or center if used as built in dishwasher.
Currently I've put in some simpler formula which i'm not satisfied with. What i would want is,
If i tick in example, Handle left, the other 2 options should untick, and vice versa.
Basically, only 1 handle at the time being able to show.
As it is now the 2 handles without the formula can be ticked at the same time.
Grateful for any help, and if the answer is above but I can't understand and see it, just point me to it and I'll dig deeper.
Thanks!
If you have more than 2 conditions then it is better to use an integer parameter to drive the visibility parameters.
Can't find what you're looking for? Ask the community or share your knowledge.