Sort Rhino geometry by colour

Hi All,

I have a collection of surfaces in a rhino file that I would like to sort by colour into seperate lists

Eventually, to be able to sort volumes by the colour of the surface below:


230810_sort surface by colour.gh (995.5 KB)

Thank you in advance for any help!

Hi @user23 ,

In Rhino 8 WIP you can do this with a single node called “Group Content” and use Display.Color as the key.

In case you aren’t using R8 I’ve also created a python script that groups by object color as well for use in R7 or below.

If you don’t have R8 and open the file you can ignore the warnings you will get and delete the R8 node or copy the R7 python version out to a different file.

It doesn’t appear that your surface object colors came through in grasshopper so I just assigned some similar values for testing on some of them. It should work on your end, just an FYI for future uploads.

Graph Space:

Model Space (snip showing me selecting the 2nd group in the data tree):

20230810_sort surface by colour_Response_01a.gh (752.4 KB)

Cheers!

3 Likes

Thank you Michael! This works perfectly.

You’re welcome! Out of curiosity did you go with the Python script or the Rhino 8 route?

Went with the Python script - mostly for ease of use across different computers without needing a new install.

1 Like

Cool, let me know if you run into issues in using it. I just created it today for this so I haven’t really tested it at all

Works well for what I needed!

Ended up then filtering buildings above by each list of colour items, not the most elegant but will do for now.

Maybe a simpler solution here:

Graph Space:

Model Space Preview:

20230810_sort surface by colour_Response_01b.gh (751.5 KB)

1 Like

Oh thank you for that - super cool, and indeed improved.

1 Like

You’re welcome @user23 !

1 Like