Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

REVIT MULTIPLE IF CONDITIONS WITH 4 PARAMETERS

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
5013 Views, 5 Replies

REVIT MULTIPLE IF CONDITIONS WITH 4 PARAMETERS

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

 

5 REPLIES 5
Message 2 of 6
David_W_Koch
in reply to: Anonymous

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
in reply to: Anonymous

Formula's easy to expand for multiple conditions:

parameter [ Checked_Count ] is an integer parameter

TextParam.PNG

Message 4 of 6
Anonymous
in reply to: David_W_Koch

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

Message 5 of 6
Anonymous
in reply to: FAIR59

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

Message 6 of 6
kovyljan
in reply to: Anonymous

lookup table. More limitless possibilities

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

Expert Elite Member

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


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Technology Administrators