IF/AND Statement using visibility

IF/AND Statement using visibility

dwackerX6C3B
Explorer Explorer
463 Views
3 Replies
Message 1 of 4

IF/AND Statement using visibility

dwackerX6C3B
Explorer
Explorer

Good morning,

 

What I'm trying to achieve is an IF ( AND visibility statement, outlined below:

 

X = IF ( AND (UCAL3300 = 1, Dept < 28"), 2 , 1 )

 

"UCAL3300" is a simple Yes/No visibility toggle

My goal is for "X" to always show when "UCAL3300" is toggled off and when "UCAL3300 is toggled on but the depth is greater than 28".

 

Appreciate the help.

0 Likes
Accepted solutions (1)
464 Views
3 Replies
Replies (3)
Message 2 of 4

David_W_Koch
Mentor
Mentor
Accepted solution

Assuming that X is a Yes/No parameter, the following will do what you describe:

if(not(UCAL3300), 1 = 1, if(and(UCAL3300, not(Depth > 2'  4")), 1 = 1, 1 = 0))

 

If you want X to be 2 when it is "on" and 1 when it is "off", then replace 1=1 with 2 (twice) and 1=0 with 1.

 

When UCAL3300 is unchecked, X is checked, regardless of whether Depth is less than, equal to, or greater than 2'-4".

Snag_87c2cd7.png

 

Snag_87c3ff2.png

 

Snag_87c77bb.png

 

When UCAL3300 is checked, X is checked, when Depth is less than or equal to 2'-4", but is unchecked when Depth is greater than 2'-4".

Snag_87d7ab4.png

 

Snag_87e1dca.png

 

Snag_87e34ae.png


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

0 Likes
Message 3 of 4

David_W_Koch
Mentor
Mentor

It occurs to me that the formula can be simplified.  The first if tests for whether UCAL3300 is checked or not, so there is no need to test it again.  Use this instead:

 

if(not(UCAL3300), 1 = 1, if(not(Depth > 2'  4"), 1 = 1, 1 = 0))

 

It gives the same results. 


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

0 Likes
Message 4 of 4

RDAOU
Mentor
Mentor

@dwackerX6C3B 

 

How about this? Instead of nested IFs Combine the conditions for when it is on using OR/NOT/AND together in one IF


If(or(not(UCAL3300), and(UCAL3300 , Dept > 28”)), 2>1,2<1)

 

If(or(not(UCAL3300), and(UCAL3300 , Dept > 28”)),2>1,2<1)

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes