How to read lines width for DXF curves?

Hello,
I wanted to retrieve the lines width (Stroke dimension cf. Adobe Illustrator) for DXF curves, but I didn’t succeed. Is it possible with dxflib library?

More details: I created a DXF file containing 2 curves with different line width (1 pixel and 2 pixels). When I read this file with dxflib library, I received 2 SPLINE objects with the following data (for both splines):
degree = 3
nKnots = 14
nControl = 10
flags = 8
Is there a way to retrieve the correct line width (Stroke dimension cf. Adobe Illustrator) for each curve.

Thank you,

Mihai

In your addSpline(…) implementation:

int lineweight = attributes.getWidth();

Width or lineweight in DXF means:
-3 = Standard
-2 = ByLayer
-1 = ByBlock
0-211 = an integer representing 100th of mm

See also DXF reference at:
http://images.autodesk.com/adsk/files/acad_dxf0.pdf

Thank you Andrew for your answer! It’s working fine!

Hi All,


I can not get what is addSpline(…). can you explain it ?


Thanks,
:laughing:

addSpline is part of the dxflib interface DL_CreationInterface.

See examples in test/test_creationclass.cpp

addSpline works just like addLine, etc.