Rewrite structure

Hello! Can someone tell me how this result can be obtained? I would be grateful for any help.
1.gh (12.1 KB)

just did this off quickly so there’s probably a better way of doing it in half as many components but it works.1.gh (11.4 KB)

1 Like

Yes it fits, thanks!

One method would be to use the relative item component.
The following is a description/quote I saved from @DavidRutten, (I don’t remember which post/forum it came from).

Relative Tree items are specified using offsets in the data path and item index notation. Thus:
{0;0;+1}(-1)

means "get the item in the next branch that is one level behind me"

So if the notation for a specific item is:
{0;1;4}(3)

then the relative item will be found at:
{0;1;5}(2)

unless if there is no {5} and wrap is set to true, in which case the item will be found at:
{0;1;0}(2)

/end quote
path structure/notation can be a little hard to grasp at first, but this is one of the better descriptions I have heard, (hence…saving the description!)


attached file is in Rhino 6, but I’m almost certain it would work in 5 as well. The path notation MUST correspond with the incoming Tree to operate in (T input of Relative Item).
RelativeItem.gh (23.0 KB)

2 Likes

you can remove some compnents :slightly_smiling_face:

3 Likes

Wow that’s very cool!