I am trying to group elements in a list using the List.GroupByKey node but I am having problems using this for sublists.
As can be seen below I am collecting all Analytical Floor Elements.
I am then grouping this based on the values of a “Level/Zone” parameter, using the List.GroupByKey node, works all OK.
For each of these sublists I wish to group by another parameter. I feel as though I should be using the List.Map node because you use this node to work on sublists but this is not working.
The Clockwork Package has a List.GroupListOfListByKey node but I am having trouble getting this to work. (not sure which key index to pass to it)
f
Group sublists.dyn (13.6 KB)
Would love some help solving this.
2 Likes
Hi Brett,
I hope this is helpful:
First the cable trays are grouped by Reference Level which gives me 4 sublists. Then i group them by Family.
Kind regards
1 Like
Thanks Martin,
Getting me closer but not 100% there.
I was able to use the group by function key and feed it into list.map node for the second parameter key so that it applies to the sublists but I can’t get it to work when using a nested second parameter.
The top row is when I have nested parameter feeding into the second group by function. If you see the list.map output on the RHS I’m not getting sublists with unique keys.
Where as when I only feed one parameter key into the group by function I am getting unique keys for the sublist.
Hope this explains my problem
Seems like List.Combine should help
8 Likes
Vikram, thanks very much!
It always seems so obvious when the correct answer is shown to you.
2 Likes
This was my solution to the problem Thankyou very much!!
1 Like
I’ve been trying to solve this problem for hours now and you finally gave me the solution. I cannot thank you enough lol.
1 Like
Great solution, thanks! Never would have solved it on my own. Works also for geometry.