How Can I to test if a color is from ByLayer or a color White, Green...

Jul 30, 2013 at 2:16 PM
So, I printed arc.Color and showed up "ByLayer". I wanna to access this value, but I can't to find it. How can I do it?

Sorry for my english, I'm brazilian :)
Coordinator
Jul 30, 2013 at 5:46 PM
When an entity has a color defined as ByLayer, which is equivalent as having a color index of 256, means that the color used to draw the entity will be defined by the layer to which it belongs. So, in this case, you will need to access the layer color to know which color to use when drawing the entity.
This is how AutoCad works, by default, all color entities are defined by the layer, but you can always override this behavior assigning a different color to the entity.

Daniel
Coordinator
Jul 31, 2013 at 6:02 PM
On the next update I will add two bool properties to the AciColor class, IsByLayer and IsByBlock, to check if the color has an index of 256 or 0, respectively. This will avoid having to remember these reserved indexes and, hopefully, it will make the code a little more readable.

Daniel