How to work with Revit’s Yes/No parameters in PropertyWizard formulas

PropertyWizard treats Revit’s Yes/No parameters as True/False boolean values. So it is easy to use Yes/No parameter values in formulas, and it’s easy to set Yes/No parameters from formulas.

Using Yes/No parameter values

You can use a Yes/No parameter value anywhere that is expecting a True/False data value. So you can use them:

  • As the <condition> in an if() function
  • In the logical functions and() and or()
  • In the logical operator expressions And, Or and Not

For example, to use an if() function to tell if a wall top is attached, you would do something like this:

if([Top is Attached], "Top is attached", "Top isn't attached")

Similarly, to indicate the walls that have both top and base attached, you could use an and() and an if() like this:

if(and([Top is Attached], [Base is Attached]), "Base and Top are both attached", "Base and Top are not both attached")
PropertyWizard Formula window showing a formula for the category 'Walls', Target Property is 'DWD-BaseTopText' and the Formula text is "if(and([Top is Attached], [Base is Attached]), "Base and Top are both attached", "Base and Top are not both attached")"

Setting Yes/No parameters

You can set a Yes/No parameter using any expression that results in a True/False value.

  • The literals true and false
  • The identifier of a True/False parameter
  • The identifier of a boolean API Property
  • The logical functions and() and or()
  • The logical operator expressions And, Or and Not

So if you have a Yes/No project parameter, you can set it by simply using:

and([Top is Attached], [Base is Attached]) 
PropertyWizard Formula window showing a formula for the category 'Walls', Target Property is 'DWD-BaseAndTopAttached' and the Formula text is "and([Top is Attached], [Base is Attached])"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.