I think my brain is frozen today and I can’t solve it.
I have to build a tree structure (TARGET) where each item from the SOURCE tree is replaced with respective paths from the ITEM tree:
More or less the intention is shown using set elements (if only this accepted multiple items).
The empty branches must remain.
Internalized data attached. data tree trouble.gh (7.3 KB)
I’m sure the solution is simple, just not for me today.
I could join-split the text but it is stupid af.
should the values on this tree be perpetually incremental?
like {0} starts with 16, {1} starts with 17, {2} starts with 18
so {3} starts with 19 and so on?
Nope. Consider both as everchanging list.
The item from the second list becomes a content of the path from the first list.
I have managed to solve it with text join-split and the result is what I expect:
if the two lists have the very same number of branches and structure, a simple List Item should do the job
here I have simulated the lists having same branches with Tree Stats + Tree Branch, but it won’t be necessary in your original -complete- data if the number of paths is already matching:
I agree, it seems weak and fragile. Watching this thread because I often encounter similar problems in GH, with not much apparent complexity upstream, and expect there are smarter ways to handle data with components instead of tinkering with fixed text strings
@Piotr if you don’t mind to post a single set of your data in such a way it’s a complete set that we can see in our GH, with the solution you have also found yourself with Split Text, it would be very useful!
Have a look at the tall image for answer and guide.
The content of the path from first tree {0}, {1} or {2} should replace the value 0,1 or 2 in the second tree respectively.
ahhhhhh now I got it, you want he whole content of each Branch
if you are open to plugins like the -awesome- Metahopper, the Wrap List component can group anything (not just geometries), in such a way you can effectively List Item on Paths directly (eventually Trim Tree at the end if you are ok on having items from different paths in the same branch, or not)
this is the same approach as the one you used, but instead of joining and splitting text items, it wraps them
of course here you can put anything as data to be duplicated, as you are just interested in the tree structure to be used with Unflatten, not at all about its content:
Metahopper was not an option but I really admire the solution based on a vanilla component.
Create fake tree to use it as a guide - bravissimo
Thanks for your time.