Coloring groups of buildings with similar heights

Hello good people!

As I am still a noobie with GH I was searching for a way to place colors on a large set of buildings based on their height. I want to split them into 6 different groups and give them their unique color, so they are easily readable.

I want to divide them into groups with heights between
1 and 9,
9 and 12,
12 and 16,
16 and 21,
21 and 28
and everything above 28

I started something of a script, but I can’t really get what I really need out of it. Can you please help me out? I will appreciate it a lot! Thank you in advance!

Building (18.4 KB)

You didn’t internalize your geometry.

Here’s an example with a couple concepts that might be applicable.

Re_Building (9.4 KB)

1 Like

Using fake geometry…

Building (22.6 KB)

1 Like

Thank you both so much!
I had problems exchanging the lines with the mesh to test it, which is totally my fault, thank you very much!
@ Joseph_Oster
I connected it to the meshes and it worked, sorry that I didn’t internalize the geometry from the beginning.
Do you think that there is a way to assign custom colors?

Here is the reworked version
Building heights (21.7 KB)

Yes, but the geometry you provided (six “buildings”) is not adequate for testing.

I used them to test it, if the script maps the heights correctly. Here is a larger part, I hope it is okay like this.

Building (888.3 KB)

First, I needed to modify version ‘A’ so the branches correspond to the list of domains, smallest to tallest. This required rebuilding the data tree by selecting branches:

Building (23.5 KB)

Then I replaced ColorB (Color Branches) with a list of custom colors:

Building (19.8 KB)

And finally I used the first 100 (out of 675) of your buildings:

Building (264.5 KB)

Here is an image showing all of them:


Thank you so much! I have to be honest I would have never figured it out!
I guess I’ll need some spare time to carefully study the script :smiley:

Here is a MUCH SIMPLER model: Simple is not always obvious. :sunglasses:

Building (258.9 KB)

Just another way, based on @Joseph_Oster 's last proposal:

Thank you both so much for your great help!