Is there a quick way to change colors of multiple / many / all layers?

Hopefully an easy question! I see that you can select multiple layers at once and then turn them all off or on, but when I click on the color swatch of one of the selected layers and then change it, it only changes the color for that particular layer.

Basically I’d like to make all my layers the same (white?) except for demo (say, red) and new (say, gray) layers. Then I can create scenes with a color-by-layer style, like “Demo” (all existing plus stuff to be demolished) and “New” (all existing plus new stuff) and quickly see the scopes of work…

Thanks!

Can’t you accomplish this using the visibility of the layers? That is, set the scene properties to remember layer visibility, turn off the layers you don’t want shown in a scene, update the scene and it will thereafter vanish those layers when you change to that scene. Then you only need different layer colors for semantically different types of objects.

There is probably a better way, but I was just goofing around with some ruby code and if you open the ruby console
Window>Ruby Console and paste this code in it should set all the layers you have in the model to white.

model = Sketchup.active_model
layers = model.layers
 
layerarr = layers.to_a
 
for i in layerarr
  i.color = Sketchup::Color.new(255, 255, 255)
end

Then you can adjust the layers you want to get color formatting you want.

3 Likes

A tool to set up new/existing layers with RGB colors from a text list.

A tool to export existing layers and their RGB colors into a text list, for use in another model or to modify it and then reload it with its sibling tool.

4 Likes

Here is simple example taking Wade’s idea one step further, by saving the previous colors, and adding a command to reset the colors back.

[code] Set Layer Colors menu command example

1 Like

Yes, that makes sense–but with that technique there’s no visual differentiation between existing conditions and items to be demolished (in a demo scene) or between existing conditions and proposed items (in a construction scene). I think it’ll be helpful to have those items a different color, both for myself, and for clients in review meetings.
On a side note, can you explain what you mean by “semantically different types of objects”? Like walls vs. furniture vs. appliances vs windows, etc.?

Wow, Wade, thanks a lot. That worked like a charm!

1 Like

I meant any groups that have different meanings that you want to emphasize. Your demo vs new is an example, but so are the others you listed.