Switch path component in Grasshopper?

grasshopper
unhandled

(Velocir) #1

Basically, I’ve got a few instances of a situation like that pictured, where I have a component that is sometimes used but not always. So far I’ve been manually connecting/disconnecting them as required but I’d like to use a kind of path A or path B switch component instead. Similar to the Gate Or component but with a toggle to choose A or B. Does that exist?


(Pascal Golay) #2

Hello - it looks like this will work:

image

-Pascal


(Velocir) #3

Perfect, thank you!


(David Rutten) #4

In addition to @pascal’s solution, the Sift/Combine pattern is the most recent and in my opinion best solution to conditional execution in Grasshopper. Sift works very similar to Filter, but it retains nulls in the output that isn’t used, which allows Combine to put data from multiple streams back together again in the same order. Admittedly, this pattern was designed with the idea that different data items need to follow different paths through the network, but the global on/off switch, the Filter will work just as well.