List.GroupBy, how to get result form rest of the list?

I have grouped points by its z value. I’am able to pull the result that I want from index of one sublist, but how can I loop thru rest of the sublist to get the result? any suggestion? Thanks

Doesn’t work:

I think you just need to put 0..3 in parenthesis. (0..3)
But really you should be able to do it with levels.

Thanks for reply Nick
It still not working. same result, It only return the first list of the sub list.

You just want the first list of every sublist right?

1 Like

I hope this image will explain what I want:

Then you need to go to the second level. You might also want to keep list structure depending on what you’re doing next.


Thanks a lot Nick, It works. Is there any way to use level syntax in the code block?

You could try setting lacing to longest, but that can be dicey. and a series of functions could also do the trick. Levels is a lot easier and faster though.

When in doubt, right click and use Node to Code to see the Design Script syntax.

1 Like



what a awesome trick:+1:

1 Like