📄 dxf.txt
字号:
VIEW 40 and 41 (view height and width), 10 and 20 (view center
point), 11, 21, 31 (view direction from target, in WCS), 12,
22, 32 (target point, in WCS), 42 (lens length), 43 and 44
(front and back clipping planes-offsets from target point), 50
(twist angle), 71 view mode (see VIEWMODE system variable
Appendix A).
UCS 10, 20, 30 (origin), 11, 21, 31 (X axis direction), 12, 22, 32
(Y axis direction). All in World coordinates.
VPORT 10 and 20 (lower left corner of viewport; 0.0 to 1.0), 11 and
21 (upper right corner), 12 and 22 (view center point), 13 and
23 (snap base point), 14 and 24 (snap spacing, X and Y), 15
and 25 (grid spacing, X and Y), 16, 26, 36 (view direction
from target point), 17, 27, 37 (view target point), 40 (view
height), 41 (viewport aspect ratio), 42 (lens length), 43 and
44 (front and back clipping planes; offsets from target
point), 50 (snap rotation angle), 51 (view twist angle), 71
(view mode; see VIEWMODE system variable in Appendix A), 72
(circle zoom percent), 73 (fast zoom setting), 74 (UCSICON
setting), 75 (snap on/off), 76 (grid on/off), 77 (snap style),
78 (snap isopair).
The VPORT table is unique in that it may contain several
entries with the same name (indicating a multiple-viewport
configuration). The entries corresponding to the active view-
port configuration all have the name "*ACTIVE". The first
such entry describes the current viewport.
DWGMGR For future use. Fields not yet defined.
C.1.5.3 BLOCKS Section
The BLOCKS section of the DXF file contains all the Block Definitions.
This section contains the entities that make up the Blocks used in the
drawing, including "anonymous" Blocks generated by the HATCH command and by
associative dimensioning. The format of the entities in this section is
identical to those in the ENTITIES section described below, so refer to
that section for details. All entities in the BLOCKS section appear
between BLOCK and ENDBLK entities. BLOCK and ENDBLK entities appear only
in the BLOCKS section. Block definitions are never nested (that is, no
BLOCK or ENDBLK entity ever appears within another BLOCK-ENDBLK pair).
C.1.5.4 ENTITIES Section
Entity items appear in both the BLOCK and ENTITIES sections of the DXF
file. The appearance of entities in the two sections is identical, with
the exception that entities in the BLOCK section never have handles. The
following gives the format of each entity as it appears in the file. Some
groups that define an entity always appear, and some are optional and
appear only if they differ from their default values. In the following
11
AutoCAD Reference Manual
discussion, groups that always occur are given by their group number and
function, while optional groups are indicated by "-optional N" following
the group description. "N" is the default value if the group is omitted.
Programs that read DXF files should not assume that the groups describing
an entity occur in the order given here. The end of the groups that make
up an entity is indicated by the next 0 group, beginning the next entity or
indicating the end of the section.
Remember that a DXF file is a complete representation of the drawing data-
base, and that as AutoCAD is further enhanced, new groups will be added to
entities to accommodate additional features. Writing your DXF processing
program in a table-driven way, making no assumptions about the order of
groups in an entity, and ignoring any groups not presently defined, will
make it much easier to accommodate DXF files from future releases of
AutoCAD.
Each entity begins with a 0 group identifying the entity type. The names
used for the entities are given in the table that follows. Every entity
contains an 8 group that gives the name of the layer on which the entity
resides. Each entity may have elevation, thickness, linetype, or color
information associated with it. If handles are enabled, every entity has a
5 group containing its handle (as a string representing a hexadecimal
number). The following groups are included only if the entity has nonde-
fault values for these properties.
Group code Meaning
6 Linetype name (if not "BYLAYER"). The special name "BYBLOCK"
indicates a floating linetype.
38 Elevation (if nonzero). Output only if system variable
FLATLAND is 1. Otherwise, Z coordinates are supplied as
3x-groups as part of each of the entity's defining points.
39 Thickness (if nonzero).
62 Color number (if not "BYLAYER"). Zero indicates the
"BYBLOCK" (floating) color.
210, These groups are included for each Line, Point, Circle, Shape,
220, Text, Arc, Trace, Solid, Block Reference, Polyline, Dimension,
230 Attribute, and Attribute Definition entity if its extrusion
direction is not parallel to the World Z axis. The indicate
the X, Y, and Z components of the entity's extrusion direction.
The rest of the groups that make up an entity item are described below.
Many of the entities include "flag" groups. These are integer codes (6x or
7x groups) that encode various pieces of information regarding the entity,
and are specific to the particular entity type. In the following descrip-
tions, the term "bit-coded" means that the flag contains various true/false
values coded as the sum of the bit values given. Any bits not defined in
the following section should be ignored in these fields and set to zero
when constructing a DXF file.
12
(C) Drawing Interchange and File Formats
LINE 10, 20, 30 (start point), 11, 21, 31 (end point).
POINT 10, 20, 30 (point), 50 (angle of X axis for the UCS in effect
when the Point was drawn -optional 0, for use when PDMODE is
nonzero).
CIRCLE 10, 20, 30 (center), 40 (radius).
ARC 10, 20, 30 (center), 40 (radius), 50 (start angle), 51 (end
angle).
TRACE Four points defining the corners of the trace: (10, 20, 30),
(11, 21, 31), (12, 22, 32), and (13, 23, 33).
SOLID Four points defining the corners of the solid: (10, 20, 30),
(11, 21, 31), (12, 22, 32), and (13, 23, 33). If only three
points were entered (forming a triangular solid), the third
and fourth points will be the same.
TEXT 10, 20, 30 (insertion point), 40 (height), 1 (text value), 50
(rotation angle -optional 0), 41 (relative X scale factor
-optional 1), 51 (obliquing angle -optional 0), 7 (text style
name -optional "STANDARD"), 71 (text generation flags
-optional 0), 72 (justification type -optional 0), 11, 21, 31
(alignment point -optional, appears only if 72 group is
present and nonzero).
The "text generation flags" are a bit-coded field with mean-
ings as follows:
Flag bit value Meaning
2 Text is backwards (mirrored in X)
4 Text is upside down (mirrored in Y)
The "justification type" value (not bit-coded) indicates the
text justification style used on this entity, as shown in the
following table.
Value Meaning
0 Text is left justified
1 Text is centered along its baseline
2 Text is right justified
3 Text is aligned between two points (height varies)
4 Text is "middle" (fully) centered
5 Text is fit between two points (width varies)
If the justification is anything other than 0 (left justi-
fied), 11, 21, and 31 groups will also appear in the entity
to specify the alignment point of the text (center, right-
most, or second alignment point).
DXFOUT handles ASCII control characters in text strings by
expanding the character into a "^" (caret) followed by the
13
AutoCAD Reference Manual
appropriate letter. For example, an ASCII Control-G (BEL,
decimal code 7) is output as "^G". If the text itself con-
tains a caret character, it is expanded to "^ " (caret,
space). DXFIN performs the complementary conversion.
SHAPE 10, 20, 30 (insertion point), 40 (size), 2 (shape name), 50
(rotation angle -optional 0), 41 (relative X scale factor
-optional 1), 51 (obliquing angle -optional 0).
BLOCK 2 (Block name), 70 (Block type flags), 10, 20, 30 (Block base
point). Appears only in BLOCKS section. The "Block type
flags" are bit-coded, with the following bit meanings:
Flag bit value Meaning
1 This is an "anonymous" Block generated by
hatching, associative dimensioning, or
other internal operations.
2 This Block has Attributes.
ENDBLK No groups. Appears only in BLOCKS section.
INSERT 66 ("Attributes follow" flag -optional 0), 2 (Block name),
10, 20, 30 (insertion point), 41 (X scale factor -optional
1), 42 (Y scale factor -optional 1), 43 (Z scale factor
-optional 1), 50 (rotation angle -optional 0), 70 and 71
(column and row counts -optional 1), 44 and 45 (column and
row spacing -optional 0).
If the value of the "Attributes follow" flag is 1, a series
of Attribute (ATTRIB) entities is expected to follow the
INSERT, terminated by a sequence end (SEQEND) entity.
ATTDEF 10, 20, 30 (text start), 40 (text height), 1 (default value,
see TEXT above for handling of ASCII control characters), 3
(prompt string), 2 (tag string), 70 (Attribute flags), 73
(field length -optional 0), 50 (text rotation -optional 0),
41 (relative X scale factor -optional 1), 51 (obliquing angle
-optional 0), 7 (text style name -optional "STANDARD"), 71
(text generation flags -optional 0, see TEXT above), 72 (text
justification type -optional 0, see TEXT above)), 11, 21, 31
(alignment point -optional, appears only if 72 group is
present and nonzero).
The "Attribute flags" are a bit-coded field in which the bits
have the following meanings:
Flag bit value Meaning
1 Attribute is invisible (does not display)
2 This is a constant Attribute
4 Verification is required on input of this
Attribute.
8 Attribute is preset (no prompt during
insertion)
14
(C) Drawing Interchange and File Formats
ATTRIB 10, 20, 30 (text start), 40 (text height), 1 (value, see TEXT
above for handling of ASCII control characters), 2 (Attribute
tag), 70 (Attribute flags; see ATTDEF above), 73 (field
length -optional 0), 50 (text rotation -optional 0), 41 (rel-
ative X scale factor -optional 1), 51 (obliquing angle
-optional 0), 7 (text style name -optional "STANDARD"), 71
(text generation flags -optional 0, see TEXT above), 72 (text
justification type -optional 0, see TEXT above), 11, 21, 31
(alignment point -optional, appears only if 72 group is
present and nonzero).
POLYLINE 66 ("vertices follow flag"), 70 (Polyline flags), 40 (default
starting width), 41 (default ending width), 71 and 72 (poly-
gon mesh M and N vertex counts -optional 0), 73 and 74
(smooth surface M and N densities -optional 0), 75 (smooth
surface type -optional 0). The default widths apply to any
vertex that doesn't supply widths (see below).
The "vertices follow" flag is always 1, indicating that a
series of VERTEX entities is expected to follow the POLYLINE,
terminated by a sequence end (SEQEND) entity. The "polyline
flags" group is a bit-coded field with bits defined as fol-
lows:
Flag bit value Meaning
1 This is a closed Polyline (or a polygon
mesh closed in the M direction)
2 Curve-fit vertices have been added
4 Spline-fit vertices have been added
8 This is a 3D Polyline
16 This is a 3D polygon mesh. Group 75 indi-
cates the smooth surface type, as follows:
0 = no smooth surface fitted
5 = quadratic B-spline surface
6 = cubic B-spline surface
8 = Bezier surface
32 The polygon mesh is closed in the N direc-
tion
VERTEX 10, 20, 30 (location), 40 (starting width -optional, see
above), 41 (ending width -optional, see above), 42 (bulge),
70 (vertex flags), 50 (curve fit tangent direction
-optional). The bulge is the tangent of 1/4 the included
angle for an arc segment, made negative if the arc goes
clockwise from the start point to the end point; a bulge of 0
indicates a straight segment, and a bulge of 1 is a semicir-
cle. The meanings of the bit-coded "vertex flags" are shown
in the following table.
15
AutoCAD Reference Manual
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -