Controlling yes/no visibilty with an if/then formula.

Controlling yes/no visibilty with an if/then formula.

Anonymous
Not applicable
5,989 Views
11 Replies
Message 1 of 12

Controlling yes/no visibilty with an if/then formula.

Anonymous
Not applicable
Hi, I'm trying to control the visibilty of part of a door tag with a formula but I can't quite get it. The goal is to have a door tag with a separate box for a fire rating to go in. The box is only visible if the door is rated, ie- IF(Fire Rating > 0). See attached. Fire Rating is the standard category parameter on the label. I can't get this to work. I've looked at the help file and other posts on formulas but they don't address this formula in simple enough terms. Can anyone help??? Thanks, KT
0 Likes
Accepted solutions (2)
5,990 Views
11 Replies
Replies (11)
Message 2 of 12

cjfollmer8063
Contributor
Contributor
Accepted solution
The Fire Rating parameter is Text type paramer, not Integer based. You will need to create your own rating parameter (Shared Parameter) that is Integer based and then your IF THEN should work.

CJ
0 Likes
Message 3 of 12

Anonymous
Not applicable
i had a similar problem recently. it seems that yes/no parameters don't play well with IF ( AND/BUT logic, however the problem is the same. you'll want an interim formula of some sort as y/n parameters while they exist as 1/0 can't be referred to as such as best i can tell. i wanted to turn off an item if either of 2 check boxes was tagged. those 2 parameters lets call Y/N_Value1 (and 2)

Visibility_formula parameter was created as =IF (OR (Y/N_Value1, Y/N_Value2),1,0) (syntax is probably off from memory) and had the Visibility parameter = IF Visibility_formula=1 controlling the dependent object.
0 Likes
Message 4 of 12

Anonymous
Not applicable
Accepted solution
You can use what amount to IF statements in Yes/No, but it uses what amounts to a short-hand version. The No portion of the if statement is implied. Meaning, you test if it is true, and if its not true you don't put anything in. To test if something is true you simply place the parameter on that line. inside parentheses. if you want it to show true for a not-true condition elsewhere, you place a "not" in front of it. Say " is "Lite" is another Yes/No parameter. If I want another Yes/No to be opposite, you would type the formula as "not(Lite)" This is in effect saying If (Lite=Yes, No, Yes) in normal Revit If/Then syntax.

Scott Womack
0 Likes
Message 5 of 12

Anonymous
Not applicable
IF works, however IF AND or IF OR do not seem to in yes/no parameters. i may have had the syntax muddled, if you can provide me with a working yes/no using OR referencing two other yes/no states i'd be very excited.
0 Likes
Message 6 of 12

Anonymous
Not applicable
unjust wrote:
> IF works, however IF AND or IF OR do not seem to in yes/no parameters. i
> may have had the syntax muddled, if you can provide me with a working
> yes/no using OR referencing two other yes/no states i'd be very excited.


your formula for Parameter1 would be:

or(Parameter2, Parameter3)


For yes/no parameters the IF and results are implied, you don't need to
include them. When used in a yes/no parameter, the above formula is
evaluated equivalent to:

if(or(Parameter2, Parameter3), Yes, No)

--
Brian Winterscheidt
LWPB Architecture
Oklahoma City, Oklahoma
0 Likes
Message 7 of 12

Anonymous
Not applicable
so the "IF (" part of the syntax isn't required in yes/no parameters?
0 Likes
Message 8 of 12

Anonymous
Not applicable
The following statement needs three other items to evaluate to be true for the item is is controling to be true.
and(Vertical Mullion Array Visibility, not(No Vertical Mullions), not(Center Vertical Mullion Visibility))

I Hope this helps.

Scott Womack
0 Likes
Message 9 of 12

Anonymous
Not applicable
so multiple AND tests can be used, but in summary:

syntax for yes/no conditional formulas is:

omit the "IF (" that is used in other parameter types, it is assumed

separate conditionals as any other formula

do not include any true or false result values
0 Likes
Message 10 of 12

Anonymous
Not applicable
Yes!
0 Likes
Message 11 of 12

Anonymous
Not applicable
wonderful, thanks.

i really wish there was more documentation on this sort of thing that was easy to reference.
0 Likes
Message 12 of 12

Anonymous
Not applicable

See the link:

http://www.revitcity.com/forums.php?action=viewthread&thread_id=21357

There is file uploaded in this forum with the name "80676_RoomTag.rfa

This is the best Example of Yes/No conditional usage in formula, I have ever seen so far!

0 Likes