GH - List Query, "Group" items

Hello,
I am trying to “group” together elements based on their names in sub paths, without success.
In red what I get, in green what I am looking for.
It works on single lists but on sub-lists nope.
Any help, highly appreciated.
Thanks

Lists.gh (19.5 KB)

Two ways


Lists_solved.gh (21.6 KB)

The top one is vanilla grasshopper. You cannot directly use the output from member index because the trees don’t match. You need to trim tree, rearrange the list by the indices, and then unflatten the list by the member index.

The bottom one is using Rhino 8’s Model Object components. You convert the text into a model object (which by default gives you empty object with the name as the input text) and then use the ‘Group Content’ component to arrange the Objects. After that you can just extract the name again. A bit hacky - but helps avoid Data Tree matching issues.

2 Likes

Fantastic!!
Thanks so much for this!!

1 Like