Page 1 of 1

How to read lines width for DXF curves?

Posted: Mon Apr 27, 2009 3:45 pm
by m_alexm
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

Posted: Mon Apr 27, 2009 4:23 pm
by andrew
In your addSpline(...) implementation:

Code: Select all

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

Posted: Tue Apr 28, 2009 4:20 pm
by m_alexm
Thank you Andrew for your answer! It's working fine!

Posted: Fri Dec 04, 2009 1:36 pm
by patricksnead24
Hi All,


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


Thanks,
:lol:

Posted: Fri Dec 04, 2009 5:37 pm
by andrew
addSpline is part of the dxflib interface DL_CreationInterface.

See examples in test/test_creationclass.cpp

addSpline works just like addLine, etc.