Group by function does not work properly

Hi

Im trying to group a list of points by their Z coordinates but after they are grouped there are points which have the same z coordinates are grouped into two groups. Im not sure if it’s some kind of bug or if Im doing something wrong.

You could try to use a Flatten node or manipulate the List@Level, see on this page:
http://dynamoprimer.com/en/06_Designing-with-Lists/6-3_lists-of-lists.html

The list is already flattened. I have also pruned it to avoid any inaccuracies.

There may be slight variances in the Z values that Dynamo is rounding? Just a guess.
Try getting the Z value and rounding it before using List.GroupByKey.

2 Likes

My guess is that they are slightly off.

List.GroupByKey instead, getting the points Z values and round them to the 3rd decimal digit with the Math.Round node.

3 Likes

Nick you are like 30 seconds ahead of me today. :smile:

1 Like

If ya aint first, yer last!

1 Like

Hehe,

yeah. it worked! Thanks!