Pick'n Choose with different list length

I do want to switch between two different states, to obtain the overall bounding box rectangle for one or all my pieces. I do tried the Pic’nChoosy component but looks like the output it is not what I do have at input. More precisely, the first option which it is only one item in the list it is multiplied to match the length of the second input, which I don’t want. I do need that the output matches exactly the input.

PickNChoosy.gh (11.3 KB)

Hey there,

The component you’re looking for is Filter

Let me try to explain what Pick’n’Choose is doing here…
This component always expects to have the same length in all its inputs, and will follow the default “longest list” behavior of Grasshopper if the inputs are not of same lengths. (almost all components have this behavior)

Here, the longest input (in your example) is input “1” : a datatree of 8 branches of lengths 1.
All the other inputs are being evaluated by the component once, for the 8 branches.
This is why the “False” is being evaluated 8 times, picking the input 0, 8 times :slight_smile:

Hope this helps !
Cheers

2 Likes

Thank you for the answer. It is working with the StreamFilter component.