Split tree based in index


This is probably quite simply but I cant figure out.

There is a tree with multiple lists A.
I would like to retrieve lists based on the index number (as shown in B).

So for instance, a list containing all the values in list A, with index 0. (and keeping the tree format),
a list with the values in list A, with index 1 etc…

I know there is the ‘get item’ command, however I would like to do it in a generic way. So I dont have to manually add an get item command if there are more values present, as shown in this example.

Furthermore 1 thing, if a list of the original tree A. has less numbers than the other lists. the output value for these indexes has to be 0.

2020-04-26 Split list in trees based on index.gh (7.0 KB)

Any suggestions?

Thank you in advance :slight_smile:

Flip matrix and graft the tree of list… problem is you want output as a tree and not a list-thus graft will have to ge done individually for all lists. I dont know of a way where you can can get multiple tree as an output with same branch names in the same component . Perhaps grouping lists can help?

Mr A.

Split list in trees based on index_RE.gh (17.8 KB)

this is the parametric way to your problem

unnamed.gh (10.0 KB)

I think that “bang tree” is not a parametric solution for this problem.