Set layer color with code possible?
-
Hi, I want to be able to set the layer color with code but not sure if its even possible. Is there any way I can achieve this?
Thanks!
-
Not possible as far i remember, i had the same question. But maybe things have changed.
-
Tig wrote a snipper for this : http://sketchucation.com/forums/viewtopic.php?t=21090
But it only sets a RGB color. No material, no reading the color.It seems adam found a way to do it with the SDK : http://sketchucation.com/forums/viewtopic.php?f=180&t=25697
Although he always forget to upload it ^^ -
Thank you I will be checking them out!
-
Right now it's pretty messy...

There is nothing in the API.
AdamB did say he found a way to do it using some C trickery, but it's never been made public.
The way my cludge works is to export the layer in a DXF then rewrite its RGB values, then re-import it, overwriting the previous layer name and moving all entities to the new 'renamed' layer...
This is frankly a poor do!Some of my tools that export DXF files [Slice(Pro)] do remap the layer colors to match some 'standards'...
Since a DXF file is in plain-text it is easy enough to stream-edit that and adjust the colors RGB values after the export is completed... -
Hopefully next API update includes this function...Thanks TIG!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement