Reading DXF: how to assign a line to a layer ?

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

Moderator: andrew

Reading DXF: how to assign a line to a layer ?

Postby rekoru » Mon Jun 24, 2013 6:20 pm

I have a DXF file with lines assigned to several layers. I would like to determine a layer for each line object in a DXF file. As there is no layer info in DL_LineData struct, I hoped to get the line->layer affiliation info using order of addLine() and addLayer() calls. I wrote simple test app and discovered that all addLayer() calls during execution of DL_Dxf::in() happen before first addLine call(). How to check to which layer a line belongs to?
rekoru
Registered Member
 
Posts: 2
Joined: Sun Jun 23, 2013 7:51 pm

Re: Reading DXF: how to assign a line to a layer ?

Postby andrew » Mon Jun 24, 2013 7:32 pm

The current layer is part of the current entity attributes. You can get the current attributes by calling
DL_Attributes getAttributes()

of your implementation of the DL_CreationInterface.
User avatar
andrew
Site Admin
 
Posts: 2367
Joined: Fri Mar 30, 2007 6:07 am

Re: Reading DXF: how to assign a line to a layer ?

Postby rekoru » Mon Jun 24, 2013 8:04 pm

I missed whole attributes thing. But now my sample works exactly as I need to :) Thank you very much!
rekoru
Registered Member
 
Posts: 2
Joined: Sun Jun 23, 2013 7:51 pm


Return to dxflib 'How Do I' Questions

Who is online

Users browsing this forum: No registered users and 1 guest