Index Color vs RGB Color (Colour)

Use this forum for all posts and questions about the free QCAD Community Edition version 3

Moderator: andrew

Post Reply
andysetchings
Registered Member
Posts: 2
Joined: Tue Apr 16, 2019 8:24 pm

Index Color vs RGB Color (Colour)

Post by andysetchings » Wed Apr 17, 2019 5:18 pm

I've found some odd behaviour while trying to use DWG TrueView to print a DXF from QCAD.

If using monochrome.ctb, the thing still prints in colour.

As far as I can tell this is because the layer colours are stored by QCAD as RGB values ('True Color in AutoCAD speak) and TrueView assigns these RGB values to the layers when opening the DXF. It is not possible to use CTB files with RGB values.

The DXF was originally from another tool and used index colours for each layer (e.g. 1 = red, 4 = cyan etc) and it worked fine with the CTB print configs but it looks like modifying it with QCAD has changed the way that the layer colours are recorded in the file so now the CTB doesnt work.

I also looked at STB configs but I think these need each layer to be tagged with a style name. I dont think QCAD will do this, correct?

So is it possible to stay with index colours for layers in QCAD... or else use layer style names?

BTW, what I'm really doing is more complex than just printing in mono - I actually have two print configs which print both sides of a photo-resist tool from the same drawing.

I also looked at the Pro trial version but I dont think it's any different in this area.

Thanks!

Regards, Andy

andysetchings
Registered Member
Posts: 2
Joined: Tue Apr 16, 2019 8:24 pm

Re: Index Color vs RGB Color (Colour)

Post by andysetchings » Wed Jun 17, 2020 7:57 pm

I was looking at this issue again today... and went round in circles covering a lot of the same ground before I found my notes from last year again.

I havent found a better answer so as a workaround I wrote a little script to modify the ASCII DXF file. The script doesn't really 'understand' DXF, it just changes the True Color RGB records in the layer info (420) into index color records (62). On the plus side it makes NO other changes to the file and you can easily check the before and after to make sure that nothing else was changed.

You will need to remove the .txt suffix from the attachment and install a perl interpreter if you dont have one. I use ActiveState ActivePerl on Windows. There are some usage notes in the comments inside the file.

QCAD will open the modified file just fine but if you save it again from QCAD then all of the layers will go back to True Color.
Attachments
true2indexcolor.pl.txt
(1.28 KiB) Downloaded 34 times

Post Reply

Return to “QCAD Community Edition”