How to read lines width for DXF curves?

Use this forum to ask questions about how to do things in dxflib.

Moderator: andrew

m_alexm
Newbie Member
Posts: 3
Joined: Mon Apr 27, 2009 3:39 pm

How to read lines width for DXF curves?

Postby m_alexm » Mon Apr 27, 2009 3:45 pm

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

User avatar
andrew
Site Admin
Posts: 4270
Joined: Fri Mar 30, 2007 6:07 am

Postby andrew » Mon Apr 27, 2009 4:23 pm

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

m_alexm
Newbie Member
Posts: 3
Joined: Mon Apr 27, 2009 3:39 pm

Postby m_alexm » Tue Apr 28, 2009 4:20 pm

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

patricksnead24
Registered Member
Posts: 1
Joined: Fri Dec 04, 2009 1:32 pm

Postby patricksnead24 » Fri Dec 04, 2009 1:36 pm

Hi All,


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


Thanks,
:lol:

User avatar
andrew
Site Admin
Posts: 4270
Joined: Fri Mar 30, 2007 6:07 am

Postby andrew » Fri Dec 04, 2009 5:37 pm

addSpline is part of the dxflib interface DL_CreationInterface.

See examples in test/test_creationclass.cpp

addSpline works just like addLine, etc.


Return to “dxflib 'How Do I' Questions”

Who is online

Users browsing this forum: No registered users and 2 guests