Making Sketchup colour all layers the same by default

Hi all,
lately I’ve started using SU for interior decoration and it’s almost like learning the program from the beginning (entirely different set of tools that you have to use.)
In this workflow, it is good to be able to present easily the electrics and I don’t want this to interfere too much with the rest of the workflow.

The best I could come up with, is create a set of switches/outlets/etc, each with a triangle ‘guide’ in a specific layer which I can turn on and off.
qqq
the produced result in plan view is something like the following:


to be worked with later in Layout.

The only thing I have to do, is colour all the layers grey and only the ‘electric guides’ layer red. (and of course assign a ‘colour by layer’ style to that scene. (I don’t use layer colour in any other case anyway)

This works fine, with not too much preparation except for having to colour all the layers (and any new one that I might introduce later in the design process.
I have found the following ruby:
model = Sketchup.active_model
layers = model.layers
layerarr = layers.to_a
for i in layerarr
i.color = Sketchup::Color.new(45, 45, 45)
end

but the problem is
a) It is boring to have to try to find it every time,open it, copy it, paste it, run it
b) with any new layers introduced I have to repeat the process.

So my question is this:
is there a way to ‘force’ sketchup to assign a specific colour to any new layer by default
or (even better) to turn this ruby into a plugin so I can assign a shortcut and run it with a press of a button.

also, if anyone has any better way of dealing with electrics, I’m willing to learn!

I think I’d take an easier route. I’d put all the electrics on a layer and set its color to red and I wouldn’t bother with the layer colors for the rest of the model. Then I would create two scenes, one of the rest of the model using the Hidden Line style with edge color set to gray and a second with only the electrics with the edge color set to By Material to show the red of the layer color. Then in LO, stack the viewports. This will give you additional controls over the way the model is displayed, too.

so, is there a way to turn it into a plugin? /or tweek sketchup to make every layer grey?

Never mind then.

sorry, by mistake I edited the previous comment instead of making a new one

That’s certainly possible, but the need is so unusual and specific and the code is so simple that I doubt anyone has written an extension for it.

I bet so too,
I wonder how people go about the electrics though…
probably the way David suggested.

‘Color by Layers’ may be a bit of a red herring for your objectives…

turn it off, add all your LX to a ‘group’ named ‘LX’ and place it on a layer named ‘LX_Layer’…

you can paint the group ‘Red’ if you need it as a separate color…

your current workflow ‘smells’ like your using Layers very oddly…

LX is used as an example, name it whatever your wish…

john

I’m not sure if I understood you:
I you mean using colour by material, how would I then present everything else in the scene grey?

My objective is to present one layer as red, and everything else as grey…
this is the only way I’ve found so far…

can you upload an example file…

john

this one is a client’s property,
I’ll make a simplified version to upload

Have you tried : Go into the layers panel, double click on a color this will bring up an edit color dialog. The color can be changed to what ever you wish.

Why not draw the electrics in LayOut on top of a plan viewport ?