How to retrieve the header properties of the DXF file?

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

Moderator: andrew

Post Reply
Cambridge Ray
Junior Member
Posts: 15
Joined: Wed Oct 03, 2012 5:26 pm

How to retrieve the header properties of the DXF file?

Post by Cambridge Ray » Mon Nov 05, 2012 12:12 am

I am referring to items like: AutoCAD Version ($ACADVER), etc. Those in Segment #1.

TIA,

-RFH

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

Re: How to retrieve the header properties of the DXF file?

Post by andrew » Mon Nov 05, 2012 12:27 am

The DL_CreationInterface::setVariable* handlers are called for those.

E.g. for $ACADVER:

Code: Select all

DL_CreationInterface::setVariableString("$ACADVER", "AC1024", 1)

Cambridge Ray
Junior Member
Posts: 15
Joined: Wed Oct 03, 2012 5:26 pm

Re: How to retrieve the header properties of the DXF file?

Post by Cambridge Ray » Mon Nov 05, 2012 12:58 am

Thanks, Andrew!

-Ramon

Oooops, I may have spoken too soon. See below...
Last edited by Cambridge Ray on Mon Nov 05, 2012 1:11 am, edited 1 time in total.

Cambridge Ray
Junior Member
Posts: 15
Joined: Wed Oct 03, 2012 5:26 pm

Re: How to retrieve the header properties of the DXF file?

Post by Cambridge Ray » Mon Nov 05, 2012 1:09 am

andrew wrote:The DL_CreationInterface::setVariable* handlers are called for those.

E.g. for $ACADVER:

Code: Select all

DL_CreationInterface::setVariableString("$ACADVER", "AC1024", 1)
Andrew:

My only use for dxflib is to read DXF files, and the purpose of the function that you mentioned seems to be to write DXF files.

I am simply trying to extend the sample provided with the distribution, so it dumps information about the DXF files on the screen. I know I can get that info with "less": Its just for my own instruction and curiosity.

-Ramon

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

Re: How to retrieve the header properties of the DXF file?

Post by andrew » Mon Nov 05, 2012 8:59 am

Everything in DL_CreationInterface is for reading DXF files. Think of the 'setVariable' and 'add*' functions from the perspective of the parser. The parser finds a variable in the DXF file and calls your setVariable* implementations to tell you what it found.

Post Reply

Return to “dxflib 'How Do I' Questions”