📄 dxf.htm
字号:
duced with a 0 group with the label "table". this is followed by a 2 group
identifying the particular table (vport, ltype, layer, style, view, ucs, or
dwgmgr) and a 70 group that specifies the maximum number of table entries</pre>
<pre> 9
autocad reference manual</pre>
<pre>that may follow. the tables in a drawing may contain deleted items, but
these are not written to the dxf file. thus, fewer table entries may
follow the table header than are indicated by the 70 group, so don't use
the count in the 70 group as an index to read in the table. it is provided
so that your program to read dxf files can allocate an array in advance
large enough to hold all the table entries that follow.</pre>
<pre>following this header for each table are the table entries. each table
item consists of a 0 group identifying the item type (same as table name,
e.g., "ltype" or "layer"), a 2 group giving the name of the table entry, a
70 group specifying flags relevant to the table entry (defined for each
table below), and additional groups that give the value of the table entry.
the end of each table is indicated by a 0 group with the value "endtab".</pre>
<pre>if any table entry has bit value 64 set in its group 70 flags, the table
entry was referenced by at least one entity in the drawing the last time
the drawing editor was entered to edit this drawing. this "referenced"
flag is for the benefit of the purge command; it can be ignored by most
programs that read dxf files, and need not be set by programs that write
dxf files.</pre>
<pre>the following are the groups used for each type of table item. all groups
are present for each table item.</pre>
<pre> ltype 3 (descriptive text for linetype), 72 (alignment code), 73
(number of dash length items), 40 (total pattern length), 49
(dash length 1), 49 (dash length 2), . . .</pre>
<pre> layer 62 (color number, negative if layer is off), 6 (linetype
name). the 1 bit is set in the 70 group flags if the layer is
frozen.</pre>
<pre> style 40 (fixed text height; 0 if not fixed), 41 (width factor), 50
(obliquing angle), 71 (text generation flags), 42 (last height
used), 3 (primary font file name), 4 ("bigfont" file name;
blank if none). if the third bit (4) is set in the 70 group
flags, this is a vertically-oriented text style.</pre>
<pre> a style table item is used to record shape file load requests
also. in this case the first bit (1) is set in the 70 group
flags and only the 3 group (shape file name) is meaningful
(all the other groups are output, however).</pre>
<pre> the "text generation flags" are a bit-coded field with the
following bit meanings:</pre>
<pre> flag bit value meaning
2 text is backwards (mirrored in x)
4 text is upside down (mirrored in y)
</pre>
<pre>10
 (c) drawing interchange and file formats</pre>
<pre> 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).</pre>
<pre> ucs 10, 20, 30 (origin), 11, 21, 31 (x axis direction), 12, 22, 32
(y axis direction). all in world coordinates.</pre>
<pre> 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).</pre>
<pre> 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.</pre>
<pre> dwgmgr for future use. fields not yet defined.
</pre>
<pre>c.1.5.3 blocks section</pre>
<pre>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).
</pre>
<pre>c.1.5.4 entities section</pre>
<pre>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</pre>
<pre> 11
autocad reference manual</pre>
<pre>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.</pre>
<pre>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.</pre>
<pre>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.</pre>
<pre>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.</pre>
<pre> group code meaning
6 linetype name (if not "bylayer"). the special name "byblock"
indicates a floating linetype.</pre>
<pre> 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.</pre>
<pre> 39 thickness (if nonzero).</pre>
<pre> 62 color number (if not "bylayer"). zero indicates the
"byblock" (floating) color.</pre>
<pre> 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.</pre>
<pre>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.</pre>
<pre>12
 (c) drawing interchange and file formats</pre>
<pre> line 10, 20, 30 (start point), 11, 21, 31 (end point).</pre>
<pre> 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).</pre>
<pre> circle 10, 20, 30 (center), 40 (radius).</pre>
<pre> arc 10, 20, 30 (center), 40 (radius), 50 (start angle), 51 (end
angle).</pre>
<pre> trace four points defining the corners of the trace: (10, 20, 30),
(11, 21, 31), (12, 22, 32), and (13, 23, 33).</pre>
<pre> 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.</pre>
<pre> 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).</pre>
<pre> the "text generation flags" are a bit-coded field with mean-
ings as follows:</pre>
<pre> flag bit value meaning
2 text is backwards (mirrored in x)
4 text is upside down (mirrored in y)</pre>
<pre> the "justification type" value (not bit-coded) indicates the
text justification style used on this entity, as shown in the
following table.</pre>
<pre> 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)</pre>
<pre> 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).</pre>
<pre> dxfout handles ascii control characters in text strings by
expanding the character into a "^" (caret) followed by the</pre>
<pre> 13
autocad reference manual</pre>
<pre> 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.</pre>
<pre> 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).</pre>
<pre> 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:</pre>
<pre> flag bit value meaning
1 this is an "anonymous" block generated by
hatching, associative dimensioning, or
other internal operations.
2 this block has attributes.</pre>
<pre> endblk no groups. appears only in blocks section.</pre>
<pre> 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).</pre>
<pre> 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.</pre>
<pre> 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -