REVIT MULTIPLE IF CONDITIONS WITH 4 PARAMETERS

REVIT MULTIPLE IF CONDITIONS WITH 4 PARAMETERS

Anonymous
Not applicable
8,655 Views
5 Replies
Message 1 of 6

REVIT MULTIPLE IF CONDITIONS WITH 4 PARAMETERS

Anonymous
Not applicable

Hi Everyone, 

I wanted to create a formula with 4 parameters and it reflects back in Text Parameter.

For Example,

If A is Checked it should display "A";

If B is Checked it should display "B";

If both A and B are Checked it should display "Select any One"

If both A and B are unChecked it should display "No Text". 

 

For two parameters I wrote the formula but I wanted this to be achieved with A, B, C, D.

 

Any help or suggestions will be appreciated.

Thanks in advance.1.JPG

 

2.JPG

 

3.JPG

 

4.JPG

 

0 Likes
Accepted solutions (3)
8,656 Views
5 Replies
Replies (5)
Message 2 of 6

David_W_Koch
Mentor
Mentor
Accepted solution

This should work for you:

if(or(and(A, B), and(A, C), and(A, D), and(B, C), and(B, D), and(C, D)), "SELECT ANY ONE", if(A, "A", if(B, "B", if(C, "C", if(D, "D", "NO TEXT")))))

 

The first if conditional tests all possible combinations of two of the four parameters to see if both are true, and combines those in a "or".  This will evaluate to True if any two or more of the four parameters are checked, and it returns "SELECT ANY ONE".

 

The only possibilities left are only one of the parameters is checked, or none are.  The else of the first conditional test is an if statement, testing to see if A is checked, if so, it returns "A", if not, another if tests if B is checked, if so, it returns "B", and so on for both C and D.  If the logical flow gets to the final else, then none are checked, so "NO TEXT" is returned.

Revit2021_FourYesNoParametersDriveValueOfTextParameter.png

 


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 3 of 6

FAIR59
Advisor
Advisor
Accepted solution

Formula's easy to expand for multiple conditions:

parameter [ Checked_Count ] is an integer parameter

TextParam.PNG

Message 4 of 6

Anonymous
Not applicable

Awesome, Understood the logic behind the formula and I got the desired output. Thank you!

0 Likes
Message 5 of 6

Anonymous
Not applicable

Thank you so much! I wonder this can be achieved through this method as well! Definitely a helpful method! 

0 Likes
Message 6 of 6

kovyljan
Advisor
Advisor
Accepted solution

lookup table. More limitless possibilities

С уважением, Ковылин Сергей Сергеевич
Инженер-проектировщик; BIM-менеджер
Адрес: Россия, г.Самара
моб.: +7 (927) 201 57 72
Skype: kovyljan
E-mail: kovyljan@mail.ru
VK | Telegram

Expert Elite Member

ОТВЕЧАЕМ НА ВАШИ ВОПРОСЫ НА ФОРУМЕ BIM2B


0 Likes