Layer by object color

Hi,
I have a problem with a model that I imported in Rhino: all the meshes are on the same layer and I need to divide the model into different layer, based on the objects colors. It’s pretty simple: select by color, create new layer, change object layer; the problem is that there are about 150 different colors.

Is it possible through a script to select all the objects in the scene and place them on different layers based on the color of the object? This problem happens to me many times and I’m looking for a solution.

Yes, it’s possible, but how do you want to name the layers? Each layer needs to have a unique name - they could be numbers or whatever.

Hi, thanks for the reply!
The name of the layer is not really important, generic name (layer 1, layer 2, ecc) will be ok.

Here is a quick hack to try:

(Edited version)
SpeciaObjColorToLayer.py (967 Bytes)

It will name the layers “OLC-” plus a sequential number.

1 Like

Thank you very much! It’s perfect!

Actually not, sorry - there were a couple of mistakes and I didn’t test thoroughly… sorry.

I edited the post above with a new version.

2 Likes

Thanks so much, really appreciated