Apply random color to layer

Hi,

Does anyone know if there is an extension capable of assigning an unique color to each layer? I would like to export a file to Autocad using color by layer…

Thanks in advanced,
José

You don’t need a plugin, the layers already have unique colours assigned when you create them.

1 Like

Thanks Box, but I do have repeated layer colours, I don’t know how that happened though. Maybe I started from a template that had modified colours…

And on the mac, I have no way of knowing the RGB values of an assigned colour :neutral_face: So I can’t be sure if the colours are different…

your right, they aren’t ‘unique’, they’re random colors…

the problem with random is it can randomly assign the same color to 100% of your layers…

unique colors need to be assigned using a formula or the AutoCAD Color Index (numbers 0-255)…

if you use the ‘color sampler’ eyedropper on the color, you should get the rgb values to change…

john

2 Likes

I’ve never used enough layers to really notice if they are unique, I assumed they would be otherwise why would you do it!.
You live and learn.

Thanks John. Using the colour picker does work for getting RGB values( have to say it is very counterintuitive ), but having to change manually one by one It’s going to be a nightmare…

Could you elaborate on the Autocad Color Index, how could I assign an Autocad colour to an Sketchup layer?
Thanks

I’m trying to find some ruby I played with for assigning them, but can’t at the moment…

the problem color I found was ‘white’ it’s in the ‘list’ twice…

AC uses it for Layer0 and you can’t see it in SU if you use a white Template, like I do…

also some colors are very close…

I keep looking…

john

Thanks John, I really appreciate it.

something like this if you don’t care what the colors are…

it’s a little faster than manually changing them…

john

1 Like

well, I tried tried it with Autocad Color Index and too many look like mud, then I tried SU named colors and many are far too light, so I wrote my own color generator which is very Goldilocks…

Then I found a plugin at SCF made to to just what you want… CLICK HERE

I had a look at his code on github and it seems like will run on a mac, so maybe try it first…

I’ll post my code in the developers forum, as I used some slightly different methods…

john

1 Like

Thank you very much, John. I really appreciate your help. I’ve tested the plugin from SCF and it works perfect.

Have a nice day,
José