Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Layer colours in DXF file

1,603 views
Skip to first unread message

Lord of Darkness

unread,
Mar 5, 1997, 3:00:00 AM3/5/97
to

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.

Thanks

John B

Robert Pavlu

unread,
Mar 5, 1997, 3:00:00 AM3/5/97
to


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

Ian A. White

unread,
Mar 6, 1997, 3:00:00 AM3/6/97
to

Please send all replies to waiw...@zip.com.au

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.

Lord of Darkness

unread,
Mar 7, 1997, 3:00:00 AM3/7/97
to

Cheers King Robert Pavlu III

> 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

0 new messages