DXF File Analysis

Source: Internet
Author: User

With the continuous development of CAD and CAM technologies, DXF files are transferred and applied between CAD and CAM as a general format. However, due to the differences in the structure or processing methods between different software, this often causes some failures in reading the DXF file. The structure and expression relationship of the DXF file are analyzed as follows, and it is helpful for readers who need to process the DXF file.

I. Structure of the DXF File
The DXF file is an ordered file consisting of the title segment, class segment, table segment, Block Segment, entity segment, and object segment. Each segment consists of "0" and "section"
Start, "0" "endsec" ends. Introduction:


1. Title segment: It mainly describes the basic information of the graphic, which is composed of AutoCAD System variables, including a variable name and variable value.
Example: (Title segment)
0
Section
2
Header
9
......
0
Endsec

2. Class segment: it consistsProgramThe specific content of a class is described in the following sections.
Example: (class)
0
Section
2
Classes
......
0
Endsec

3. Table segment: it consists of four tables (line table, layer table, Word Table, and visual chart.
Example:
0
Section
2
Tables
Note: Linear table
0
Table
2
Ltype
......
0
Endtab
Note: layer table
0
Table
2
Laype
......
0
Endtab
Note: words table
0
Table
2
Style
......
0
Endtab
Note: View charts
0
Table
2
View
......
0
Endtab
0
Endsec


4. Block: it consists of parameters of the block in the image.
Example:
0
Section
2
Tables
......
0
Endsec

5. object segment: It describes all information in the object (such as the object name, layer, line type, color, and coordinate size). It is a segment that intuitively shows the graphic features of all segments.
Example:
0
Section
2
Entities
0
Line)
......
Endsec

6. object segment: contains non-graphical states in the image.
Example:
0
Section
2
Objects
0
Endsec

The DXF graph ends with "0" "EOF.

Ii. Data Structure of the DXF file segment.
Each segment of the DXF file is composed of two rows of data. The first behavior group code consists of natural numbers, indicating the second row.Code. Generally, the meaning of common group codes is fixed, but some group codes have multiple meanings due to different environments. During analysis, You Need To determine based on different segments and expressions. (0: indicates the beginning of a transaction, 1: indicates the value in the transaction attribute, 2: indicates the name of a transaction, 3 ~ 5: Transaction Interpretation
0: indicates a start, such as a block, table, layer, and entity. 6, 7, and 8 indicate fixed types. Such as line and layer. More than 10 objects use entity segments, which have multiple meanings and need to be analyzed in detail.

Iii. Solve the read error and Analysis of the DXF file.
1. The main reason why the image cannot be read or missing is that the classes in the program are not fully set up during reading, leading to data loss of some classes.
2. The read image is multiline or inconsistent with the source image. This is mainly caused by reading other classes into your own classes.
3. The read graphic boundary is incomplete. The main reason is that the data range is not taken into account in the compilation process. As a result, only the part can be read.

To sum up, it is recommended that the image be read completely before export is smooth and then exploded, so that the reading errors will be greatly reduced after the image is converted into small blocks.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.