How to redirect the data stream into a specific output

Hello dear professionals,
Please advise how I can achieve the next result:
I have some data, lets say its a set of points. I would like to redirect the single set of points to different flows of a my script so the same single set of points will not be proceeded 3 times in different ways when I need it to be done through only the one that I want :

Similar node you might saw in Grasshopper:

You mean like:

If value X =0 then A
If value X=1 then B else C?

probably yes. I need just to have a way to send the same data to different logics selectively. And I need more than 3 possible options. Its like scenarios similar to if logic but with more than 2 possible actions. And its not elif style, since elif checks all scenarios one by one, but I don’t need to check all, I need to execute the certain one

you can try using these 2 nodes,


Below there is a Code block exaple. It takes List of Arcs and from that list take every second Arc, and then offsets for 0 or 1.

Otherwise you can always use List.Chop, List.Take, List.GetItemAtIndex and soo on. But for those nodes you need to create rules. I will try to prepare some exaple for those nodes.

This is another way of doing something like spliting values. But it would easier if you can give a real problem, so that I can see what the end result should be or what is the problem you are facing.

thank you for your replay. But you went to a totally different direction with list modification. And Im looking for some sort data routing. I don’t need to chop, split or clean it. Single set must be able to go to independent from each other portions of a script selectively

Hi, something like this? Firstly i didnt quite understand the Grasshopper node. You want to create different “graphs”, and using UI index send data to different graphs?

for me will be enough just indices (0…5)
lets say I have 1 solid object. But in different cases I need to send it to 1 out of 3 outputs , or more outputs. And each out put can take it to a different script lets say.
Its like you have 5 different script (5 dyn files), but I want to merge all 5 scripts into 1 and just play indices to select in which script this solid will go

1 Like

Ok so the CodeBlock in the previous reply will do the trick, if you replicate it, you will that if you change the Ind input, it will place the List in a different index. You can also change the number of Elements in Output using N. List can be whatever you want it to be… In the end, it was just List manipulation :wink:

Maybe something like this …


switch.dyn (6.7 KB)

Hi @m.shcheblykin try this:

you could also use multiple scopeif (or ScopeIf+ from Clockwork) nodes, but i like this better :slight_smile: