Group.ByKey. or something


Difficult to put in words but I want to group the initial elements list based on number of edges. Couldn’t find a key function directly and kinda want to work as shown. (But it won’t obviously.) Does anyone have a good idea?



you can either put both of those nodes into a custom node, or use function.compose() where the first function curtain panel - passes it’s output to the second.


thanks! But now I’ve tried both methods and both end up as a list with one element pr index as shown below. Am I missing something?




Jostein, try doing the same function compose but run it through SortByKey. Then add a further step calling on firstly the boundaries and then the number of polycurves again into Group Items by Key List. I believe this is what you are after?


curtain panel



all I get from the SortByKey node is null values?


The CP.Boundaries has some weird behavior, where it adds each processed element to a sub-list. Therefore you need to apply a flatten command to the the function as well to counteract that:



Well I don’t seem to get this at all… When I try what you say Dimitar, I get two list with all the elements repeated. Element at index [0][0][0] equals the element at index [1][0][0] and so on.


Oops, sorry Jostein - I didn’t check the output and I was sure that would work.Oh well… when you are in doubt, you should python out!

Try and see if the following helps: