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 heights.gh (18.4 KB)

You didn’t internalize your geometry.

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

Re_Building heights.gh (9.4 KB)

1 Like

Using fake geometry…


Building heights_2022Feb13a.gh (22.6 KB)

1 Like

Thank you both so much!
@Japhy
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 new.gh (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 heights_Reworked.gh (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 heights_2022Feb13b.gh (23.5 KB)

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


Building heights_2022Feb13c.gh (19.8 KB)

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


Building heights_2022Feb13d.gh (264.5 KB)

Here is an image showing all of them:

2 Likes

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 heights_2022Feb13e.gh (258.9 KB)

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

Joseph_Oster
Baris
Thank you both so much for your great help!