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!
Advertisement