How to Map Items According to a Branch Map?

I feel like there’s got to be an easy way to do this but I’m not seeing it… I have tree that I want to add items to inside of a new level of branches. I have a “branch map” for how to assign these items to the new branches. How do I accomplish this? It’s not just a simple Graft, as each branch has a different number of items. This is inside of a larger definition and there may very well be a different approach I can take, but this method seems like it should be doable.

Any help appreciated!

keep in mind that this kind of questions (generally 95% of questions) are much easier to answer when the relative GH file is posted

first step: create a data tree where branches (with placeholder path address) contain the right items

second step: Replace Branches component, replacing the current (placeholder) ones with the correct ones

tree_and_paths.gh (13.8 KB)

if you happen to be using Elefront plugin, that can be done with less components:

tree_and_paths_elefront.gh (9.6 KB)

Fantastic, thank you!

Or sort the paths instead:

(effectively replicating elefront’s Create Tree)