I'm writing code to import DXF files into my own structures. I have been
using r13dxf.zip - specs therein to obtain my information.
From what I can gather, the Layer colours are set to BYLAYER so the
groupcode 62 is always followed by 7 = color 7, but I know that the
files come out with different layers in different colours when loaded
into proper CAD readers.
Question : Can I assume that AutoCAD has a colour table with preset
colours for layers and each layer simply uses the colour at a given
index.
Can anyone tell me what the default ACAD colour table is - for (say) the
first 30 layers, if this assumption is correct.
Thanks
John B
Lord John,
Your assumption is incorrect.
A layer will always have a color assigned to it. If the user does not
specify a color, by default it will be set to color white #7. You can
find the layers color by looking at its table entry.
An entity on the other hand can have a specific color or a color of
BYLAYER #256. In this case the entity would reflect the color of the
layer that it was on.
BYBLOCK #0 is also a valid entity color. The blocks color can also be
found in its table entry.
Hope this helps,
King Robert Pavlu III
On Wed, 05 Mar 1997 15:41:15 +0000, Lord of Darkness
<J.Bidd...@rl.ac.uk> wrote:
>Hello All,
>
>I'm writing code to import DXF files into my own structures. I have been
>using r13dxf.zip - specs therein to obtain my information.
>
>From what I can gather, the Layer colours are set to BYLAYER so the
>groupcode 62 is always followed by 7 = color 7, but I know that the
>files come out with different layers in different colours when loaded
>into proper CAD readers.
>
>Question : Can I assume that AutoCAD has a colour table with preset
>colours for layers and each layer simply uses the colour at a given
>index.
>Can anyone tell me what the default ACAD colour table is - for (say) the
>first 30 layers, if this assumption is correct.
AutoCAD only "defines" the first 7 colours.
1 = red, 2 = yellow, 3 = green, 4 = cyan, 5 = blue, 6 = magenta, and 7
= white. Additionally 0 = BYBLOCK and 256 = BYLAYER.
All other colours can vary depending on the driver/platform.
--
Please send all replies to waiw...@zip.com.au
Regards,
Ian A. White, CPEng
waiw...@zip.com.au
WAI Engineering
Sydney 2000
Australia
Junk e-mail will be returned, as is, to the sender or the sender's host system.
> A layer will always have a color assigned to it. If the user does not
> specify a color, by default it will be set to color white #7. You can
> find the layers color by looking at its table entry.
>
> An entity on the other hand can have a specific color or a color of
> BYLAYER #256. In this case the entity would reflect the color of the
> layer that it was on.
>
> BYBLOCK #0 is also a valid entity color. The blocks color can also be
> found in its table entry.
>
> Hope this helps,
>
Yes, that's cleared it up for me, I was reading the layer colour
incorrectly, and I've sorted it out now.
I thought some layers were defined without a colour so I wondered what
the correct colour was on a per-layer basis, but they do all have
correct colour entries, and another responder sent me this colour map,
which works lovely, and the files all come out looking just as they
should.
1 = red, 2 = yellow, 3 = green, 4 = cyan, 5 = blue, 6 = magenta, and 7
= white. Additionally 0 = BYBLOCK and 256 = BYLAYER.
Thanks for the help
John B