Introduction to DXF

The DXF format is a tagged data representation of all the information contained in an CAD drawing file. Tagged data means that each data element in the file is preceded by an integer number that is called a group code. A group code’s value indicates what type of data element follows. This value also indicates the meaning of a data element for a given object (or record) type. Virtually all user-specified information in a drawing file can be represented in DXF format.
DXF files can be either ASCII or binary formats. Because ASCII DXF files are more common than the binary format, the term DXF file is used to refer to ASCII DXF files and the term binary DXF file for the binary format.

A dxf read and write involves various sections like:
1)Header Section
2)Classes Section
3)Table Section
4)Block Section
5)Entity Section

The group code indicates the type of value that follows according to the table below.
Group code Value type
———- ———-
0-9 string
10-59 real number
60-79 integer
210-239 real number
999 comment

As of my First milestone in GSoC I have studied all about header section and its code. About which I ll be mentioning in my next post.

ONe more thing which I have been working on is dxflib.
dxflib
dxflib is an open source C++ library mainly for parsing DXFfiles. We can make use of dxflib to import DXF files and to write DXF Files.

DXF File ----> Parsing ----> dxflib ---->function calls for adding enties etc ---->C++ Class

dxflib parses DXF files and calls functions in your class. In those functions you can for example add the entities to an entity container.

Leave a comment