Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding
Announcements
We are currently migrating data within this board to improve the community. During this process, posting, replying, editing and other features are temporarily disabled. We sincerely apologize for any inconvenience caused and appreciate your understanding. Thank you for your patience and support.

Boolean Statement w/ Text, Erroring

jessem5CN9L
Enthusiast Enthusiast
353 Views
3 Replies
Message 1 of 4

Boolean Statement w/ Text, Erroring

jessem5CN9L
Enthusiast
Enthusiast

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?

 

Reply
Reply
0 Likes
354 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.

Reply
Reply
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.

Reply
Reply
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

 

 

Reply
Reply