How to create a "Master Graph" that runs 2 dynamo graphs based on if/else condition?

Hi Everybody,

I have 2 different graphs

  1. Create Shared Parameters in families in directoy
  2. Delete Shared Parameters in families in the directory

I want to combine them into 1 and based on user input value of “True and False” run 1 of them. Basically like an IF ELSE condition- Where If the condition is True run the first graph, if the condition is false run the second graph.

Is this possible with dynamo? I know that it could be possible by creating custom nodes. Any ideas?

image

If you want to know about Master and Slave stuff, be my guest :slight_smile:

You could leave the nodes in a function state, and pass a either option 1 or option 2 to a Function.Apply node.

You could wrap all of the nodes which perform the operations of option 1 and option 2 inside some custom nodes with an added ‘run’ input, with a ‘not’ value on the test for option 2 but no change for the test on option 1.

You could do a lot of things really; the best ethos will depend upon the actual functions being performed.

Can you please give an example / demo with a dynamo graph so that I can understand what you mean :)? @jacob.small

But this does not offer conditional execution as that is what I need

What I am trying to basically do @jacob.small @Marcel_Rijsmus

So you are looking to either delete the parameters or make new ones, for a large list of family documents?

The answer in this case is to use two graphs for the two completely different set of uses. There is no value in one graph that does both as the time lost in prepping both will be wasted and users are apt to select the wrong option for an input causing extreme data loss, but are not likely to do so with selecting the right graph.

If you really wanted to use this, and again, this is a bad idea from a data fidelity standpoint:

  1. Remove the family document input from everything you have it in now.
  2. Provide all of the other inputs into the create shared parameter node.
  3. Both the creation and deletion nodes would be in a function state now; pass one into the true input of the If node, and the other into the false input.
  4. Place a Function.Apply node where the result from the If node will be the function, and the argument will be the list of family documents.

Thank you friends for helping out. @jacob.small @Marcel_Rijsmus

I have a new topic, please add your ideas/thoughts to solve the issue