Replace path based on index (index not in Numerical order)

Hi question,

There is a tree, whereby all branches contain 1 index. This inde represent a path structure.

I would like to replace the original path into the path which is present in the corresponding index.

I thought I had the ‘simple’ solution, which is shown below.

However, I noticed that when the ‘Path, names’ are NOT in Numerical order (0,1,2…), this is not working. See example below.
It looks like it has something to do that it replaces ‘the Patch Names’ based on Numerical order (0,1,2…) instead of the original given order.
2020-11-19 Replace path by index item_re_RE.gh (18.7 KB)

Any suggestions?

Thanks,

like this?


2020-11-19 Replace path by index item_re_RE_ME.gh (20.1 KB)

Hi,

Thank you for your reply, but unfortunately this is not the case.
It is important that the ‘New Branch Path Names’ are in the same order as the original indexes…

any suggestion?

thanks again :slight_smile:

The component works well, the problem is that you are trying to do something forbidden. You can’t have a tree that first has the branch {1} and then the branch {0}, because by definition, this structure is ordered. GH datatrees are not real trees, they are an ordered (by path) list of path-list pairs.

1 Like