Split Pathways in Dynamo Script


#1

In an effort to consolidate some scripts I am looking to add a data shapes node that will then select the path for the script to run. However, I can’t seem to find how to tell Dynamo to do the split. There are only 2 options and a 3rd that would be a cancel. Thoughts?


#2

@dsmith Share your dyn please


#3

Sorry for the delay the holidays snuck up on me and I got married right before them.What I am trying to do is, using Data.Shapes, get a user input. Once that input is received, it will dictate what calculation method to use. Once I get the answer though I am stuck at how to tell which option was selected to anything that would allow for it to go down a certain branch. In this case, if they user selected Flush Tank then it would do this calc but if flush valve it would do another.


#4

No need to split - just do the calcs in an if statement. Format is as follows:

Test ? ResultWhenTrue : ResultWhenFalse ;

These can be nested as well. So in your case:

Selection == “Flush Tank” ? YourCalcHere : Selection == “Flush Valve” ? OtherCalcHere : null;


#5

So I have it recognizing the output but this is where I get stuck. I don’t know how to tie in the true statement to the front end of a calculation method.

Edit: Figured it out. Added a run statement at the beginning with boolean operator and fed my items through.

Thanks Team.