I am trying to take a data tree and and move every N branches into a new branch. So for example if the tree has 100 branches, I’d like to put every 10 of them into a new branch - resulting in 10 branches of 10 branches. It’s working for lists, but I can’t get it to work for trees.
This is all dynamic so the path mapper won’t work. The background is that I have a component for putting wall panels together. Each panel is a group of sub-panels, each sub panel is a pattern of 1’s and 0’s.
To keep it fast, this is all just numbers, the numbers drive the other part of the component which is geometry.
Thanks @magicteddy for the multiple solutions, this is the first time I’ve been able to get a grip on ‘replace paths’. Also @Tao_Lin, your C# is astonishingly simple. Thank you both!
Here is the script I used from @magicteddy as applied to the problem:
Also, here is a rebuild of the tree that I ended up doing earlier in the day. Flattening and re-building the tree into a new structure was a little more intuitive than replacing actual paths: