Page 1 of 1

Reading Line color

Posted: Mon Aug 31, 2015 4:31 am
by RobinCris
I am reading dxf file and I do only 2D drawings.
I use polylines to draw a flat. On top of the polylines I draw lines (represent windows).
Because I am missing dimension, I was looking for a way to represent the window height.
I decided to use the color RGB system and to set the RED value of the line to the height. use the name of the color too.
so the colors will be 130,0,255 or 215,0,255 etc.
I do it in autocad.

The problem is that I can't find it when I read the dxf file

Please help

Re: Reading Line color

Posted: Mon Aug 31, 2015 8:36 am
by andrew
You can access the entity color as part of the member variable 'attributes' of your DL_CreationInterface implementation:
void MyClass::addLine(const DL_LineData& data) {
    int col = attributes.getColor24();
    int r = (col&0x00ff0000) >> 16;
    int g = (num&0x0000ff00) >> 8;
    int b = (num&0x000000ff);
    ...
};