Extract number from a list

Hello,
I need to extract the number 2 from the list,
thanks for helping,
Roy

Extracting the number 2 from a list that has only the number 4 is like pulling a rabbit out of a hat

But suppose you have a list that contains the number n.

There is a grasshopper component called item index which finds The index where the number n is found in the list.

If it finds the number n it will return its index, if it doesn’t find it in that list it will return -1.

Using this knowledge, you can pass the index of n , only if it is a positive number, to a cull index component

Hi Adel,

Thanks for your reply.
I was trying extracting the number 2 from the branch “{0;2}” (high right of the panel).

Use the Tree Statistics component and then Deconstruct Path…

tree_stat_dec_path.gh (11.3 KB)

1 Like

perfect! thank you

1 Like