Replace branch

Does anyone know if there’s an easier way to replace tree branches? Maybe there’s a special node?

Replace Paths is probably what you are looking for, Tree Branch can also be set to Renumber..

1 Like

Does anyone know if there’s an easier way to replace tree branches? Maybe there’s a special node?

I think the one you have shown in the screenshot is the most viable method

1 Like

We use Replace Path to do this stuff so it’s kind of the most convenient way

If Python in an option for you, you could do something like this:

from Grasshopper.Kernel.Data import GH_Path

for p, i in zip(tr2.Paths, br):
    np = GH_Path(int(i))
    tr1.RemovePath(np)
    tr1.AddRange(tr2.Branch(p), np)

a = tr1
2 Likes

Good work man! So simple, strange that there is no preinstalled node for this for people who doesnt know phyton

1 Like

Seems a little strange to me that you need the capability at all.