How to split breps in 5 separate groups based on their height and assign different colour to each group

Hi there,
I need some help with splitting all of these pyramids into 5 groups based on their height. I then want to assig different colour to each group. Imagine each of the groups/ colours will be laser cut from a different material.

There are many tutorials regarding colour swatches but all of them show how to assign gradient rather than 5 different colours.

There are 450 pyramids in total so let’s say I want 90 lowest pyramids to be one group (yellow), then the next 90 ones (a bit higher ones) - dark yellow, 90 mid-high ones - orange, next 90 ones - red and 90 highest ones to be brown.

I’ve managed to sort the height list and then separate the first 90 lowest parameters but I don’t know what to do next.

colours.3dm (179.4 KB) (20.4 KB)

I don’t have your plugin installed, anyway, this could be one of the typical approaches by using Divide Domain… BTW, the item count per group isn’t the same.

If you want the same count per color group, then, you can use Sort LIstand Partition List. (17.6 KB)

You’re my hero! Thank you so much for both options. One more question - is there a way of splitting these 450 breps now into 5 groups (based on colour). Let’s say I want to bake or unroll only the red ones now. I know how to unroll them but need to have the red ones separated from the rest of the team.

colour1 (22.5 KB)

Perfect! Thank you soooooo much.