Using if/and logic to drive model element changes


#1

Hello Dynamo Community! I’m working on developing a script to go through a project and automatically “size” air terminals based on their flows. I’ve got the first part of my script working, which is filtering out the air terminals into their specific families and types, and I have “flexed” those lists and confirmed that I am indeed able to change the air terminal families via Dynamo. Now, I am to the point where I’m constructing the logic, and I am running into some issues, admittedly, because my knowledge of constructing logic in Dynamo is in it’s infancy. Basically, what I am trying to achieve is this type of logic structure as spelled out with what I can use in excel to achieve this functionality (The H reference in this case would be the “Supply Air Flow” parameter)

As you can see, I’m running into issues at the “And” node where I’m tying the two “If” tests together. I know that I can have the “And” node report back true if I expand it’s index to the number of true inputs I would have from the two tests, but that wouldn’t be practical, especially since the intended use for this script would be on projects, where the number of Air terminals could be in the hundreds and always dynamically changing. I’m not sure if I am even going about this the correct way in Dynamo, so please, any and all input/suggestions is greatly appreciated! Thank you all for your time!


#2

Getting closer


#3

 

 

 

 

 

Found the solution, just wanted to share with everybody


#4

A few other possible approaches…


#5

Thanks Vikram, I appreciate the feedback! You’ve given me some great food for thought for cleaning up and simplifying my script.

My final structure of the script looks like this. I still have some development to do to finish it out for the different family types and scenarios, but again, my basic structure is in place


#6

As far I remember in earlier versions it was possible to use AND/NOT in the Formula node… Am I wrong?