Boolean Statement w/ Text, Erroring

Boolean Statement w/ Text, Erroring

jessem5CN9L
Advocate Advocate
973 Views
3 Replies
Message 1 of 4

Boolean Statement w/ Text, Erroring

jessem5CN9L
Advocate
Advocate

Hi all, been scratching my head on this. Given the parameters below:

jessem5CN9L_0-1721915398126.png

What I want is that when DO_Card Reader says "CR", only Red will be checked. And when DO_Card Reader says anything else, only Blue will be checked. 

 

I've used the statement  if([DO_Card Reader]="CR", 1=1, 1=0) and other variations, but I keep getting an "Improper use of boolean expressions" error. 

A different statement that has no text like "CR" works just fine. 

 

What formula can I put in here to make it work properly?

 

0 Likes
974 Views
3 Replies
Replies (3)
Message 2 of 4

djthompson
Advocate
Advocate

As incredible as it may seam you cannot do any Boolean operations with text in Revit.

Message 3 of 4

tim.ingle
Enthusiast
Enthusiast

Hi @jessem5CN9L, like @djthompson mentioned, text cannot be referenced in formulas unless it is to display a specific result in a Text parameter. A way you could get around this, would be to use another YesNo parameter to toggle the Card Reader / "CR" reference. Depending on how many values you need for the DO_Card Reader parameter, you could just duplicate this formulaic system as much as you need.

Also, in order to control YesNo parameters through formulas, they have an assumed result, where if the condition in the formula is not met, then the parameter will be equal to No (and vise versa). I've included an example of these formulas.

0 Likes
Message 4 of 4

mikewp90
Advocate
Advocate

One way is to utilize use of lookuptables which can be expanded for more complex iterations. 

mikewp90_0-1722268381973.png

mikewp90_1-1722268413280.png

mikewp90_2-1722268447809.png