Revit "IF" statement with visibility parameter

Revit "IF" statement with visibility parameter

ahuntPTQKR
Explorer Explorer
2,383 Views
3 Replies
Message 1 of 4

Revit "IF" statement with visibility parameter

ahuntPTQKR
Explorer
Explorer

Hi

I was wondering if anyone would happen to know what the correct boolean expression is for the following "IF" statement to set a visibility parameter to off/none-visible (where i've type "<output false/off>" below)

if(parameter1, parameter2, <output false/off>)

I've tried typing the following:
(which don't work)

if(parameter1, parameter2, 0) 
if(parameter1, parameter2, no) 
if(parameter1, parameter2, false) 
if(parameter1, parameter2, off) 

 

0 Likes
2,384 Views
3 Replies
Replies (3)
Message 2 of 4

RDAOU
Mentor
Mentor

@ahuntPTQKR 

 

It works as follows: if(Syntax, True, False) .... ie: if(parameter1> 1000, 2>1, 1>2)

 

 

Depending on the type of parameter1  and in simple conditions where only On or OFF is applicable, you do not need the IF you just need the TRUE part of the condition

 

Example:

 

  • when parameter1 is a length parameter and you want to make to turn visibility on for a certain length value, either of the following works:
    1. parameter1 >5'
    2. and(parameter1 > 5', parameter1 < 10')

 

  • when parameter1 is another Yes/No parameter, you just type in the formula parameter1 (meaning when parameter1 is True/ON, the visibility parameter will be also True/ON and vise versa)

 

If parameter1 is a Text parameter => it is a bust. Text can only be used as output, you cant use Text parameters as Conditions in formulas

 

 

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


Message 3 of 4

barthbradley
Consultant
Consultant

Look into embedding IF statements.   

 

e.g. IF (<condition>, <result-if-true>, IF (<condition>, <result-if-true>, IF (<condition>, <result-if-true>, <result-if-false>)))

 

 

Use Conditional Statements in Formulas | Revit | Autodesk Knowledge Network

 

Revit Formulas for "everyday" usage - Revit Forum

 

 

Message 4 of 4

LXU_MPS
Community Visitor
Community Visitor

It should be:

if(parameter1, 1=1, 1=0)

it works in 2023 version

0 Likes