⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dxf.htm

📁 刚刚看到本站有Visual C++数字图象处理(人民邮电出版社)的电子书
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<html>



<head>

<title>file:///d:/程序资料/format2/dxf.txt</title>

</head>



<body background="../jpg/di1.JPG">



<p align="center"><font size="5" color="#0000ff">drawing interchange and file formats</font></p>

<div align="center"><center>



<table border="0" width="80%">

  <tr>

    <td width="100%"> <pre>[ this file is an excerpt from the autocad release 10 reference manual.

  copyright (c) 1988 autodesk, inc.  all rights reserved. ]</pre>

    <pre>autocad can be used by itself as a complete drawing editor.  in some appli-

cations, however, other programs must examine drawings created by autocad

or generate drawings to be viewed, modified, or plotted with autocad.</pre>

    <pre>for example, if you've made an architectural drawing with autocad, using

inserted parts to represent windows, doors, and so on, you can process the

drawing file and produce a bill of materials of all the items used in the

drawing, or even make energy use calculations based on the area and the

number and type of windows used.  another possible application is to use

autocad to describe structures that are then sent to a large computer for

finite element structural analysis.  you can compute stresses and displace-

ments and send back information to display the deformed structure as an

autocad drawing.</pre>

    <pre>since the autocad drawing database (.dwg file) is written in a very compact

format that changes significantly from time to time as new features are

added, we do not document its format and do not recommend that you attempt

to write programs to read it directly.  to assist in interchanging drawings

between autocad and other programs, a &quot;drawing interchange&quot; file format

(dxf(tm)) has been defined.  all implementations of autocad accept this

format and are able to convert it to and from their internal drawing file

representation.</pre>

    <pre>autocad also supports the initial graphics exchange standard (iges) file

format.  the information comprising an autocad drawing can be written out

in iges format, and iges files can be read and converted to autocad's

internal format.

</pre>

    <pre>c.1  ascii drawing interchange (dxf) files</pre>

    <pre>this section describes autocad's dxf (drawing interchange) file format and

the commands provided to read and write these files.  dxf files are stan-

dard ascii text files.  they can easily be translated to the formats of

other cad systems, or submitted to other programs for specialized analysis.

</pre>

    <pre>c.1.1  dxfout command - writing a dxf file</pre>

    <pre>you can generate a drawing interchange file from an existing drawing by

means of the drawing editor's dxfout command.  the command format is:</pre>

    <pre>    command:  dxfout   file name &lt;default&gt;:  (name or return)</pre>

    <pre>the default name for the output file is the same as that of the current

drawing, but with a file type of &quot;.dxf&quot;.  if you specify an explicit file

name, do not include a file type; &quot;.dxf&quot; is assumed.  if a file with the

same name already exists, it is deleted.  next, dxfout asks what precision</pre>

    <pre>                                                                          1

&#12;autocad reference manual</pre>

    <pre>you want for floating-point numbers and permits output of a partial dxf

file containing only selected objects.</pre>

    <pre>    enter decimal places of accuracy (0 to 16)/entities/binary &lt;6&gt;:</pre>

    <pre>the &quot;binary&quot; option is described later in this appendix. if you respond

with &quot;entities&quot; (or just &quot;e&quot;), dxfout will ask you to select the objects

you want written to the dxf file.  only the objects you select will be

included in the output file - symbol tables (including block definitions)

will not be included.  once you've selected the desired objects, autocad

will prompt again for the numeric precision:</pre>

    <pre>    enter decimal places of accuracy (0 to 16)/binary &lt;6&gt;:

</pre>

    <pre>c.1.2  dxfin command - loading a dxf file</pre>

    <pre>a drawing interchange file can be converted into an autocad drawing by

means of the dxfin command.  first enter the drawing editor using the

&quot;create new drawing&quot; task from the main menu.  then issue the dxfin com-

mand.</pre>

    <pre>    command:  dxfin   file name:  (name)</pre>

    <pre>enter the name of the drawing interchange file to be loaded.

</pre>

    <pre>full dxfin</pre>

    <pre>to load a complete dxf file, you must use dxfin in an empty drawing, before

any entities have been drawn and before any additional block definitions,

layers, linetypes, text styles, named views, named coordinate systems, or

named viewport configurations have been created.  (if your prototype draw-

ing contains any such items, use main menu task 1's &quot;name=&quot; technique to

create a new drawing without a prototype.)</pre>

    <pre>if any errors are detected during the input, the new drawing is discarded.

otherwise, an automatic &quot;zoom all&quot; is performed to set the drawing extents.

</pre>

    <pre>partial dxfin</pre>

    <pre>if the current drawing is not empty, dxfin loads only the entities section

of the dxf file, adding the entities found there to the current drawing.

in this case, dxfin displays the message:</pre>

    <pre>    not a new drawing -- only entities section will be input.</pre>

    <pre>if errors are detected during such partial dxf input, the drawing is

returned to the state it was in before the dxfin command.  otherwise, the

newly added entities are drawn.



</pre>

    <pre>2

&#12;                                   (c) drawing interchange and file formats</pre>

    <pre>c.1.3  dxf file format</pre>

    <pre>this section describes the format of a dxf file in detail.  it contains a

great deal of technical information that you need only if you're writing

your own program to process dxf files.  otherwise, you can skip this sec-

tion.</pre>

    <pre>it would probably be helpful to produce a dxf file from a small drawing,

print it out, and refer to it occasionally while reading the information

presented below.

</pre>

    <pre>c.1.3.1  general file structure</pre>

    <pre>a drawing interchange file is simply an ascii text file with a file type of

&quot;.dxf&quot; and specially-formatted text.  the overall organization of a dxf

file is as follows:</pre>

    <pre>  1. header section - general information about the drawing is found in

     this section of the dxf file.  each parameter has a variable name

     and an associated value.</pre>

    <pre>  2. tables section -- this section contains definitions of named

     items.</pre>

    <pre>       o  linetype (ltype) table

       o  layer table

       o  text style (style) table

       o  view table

       o  user coordinate system (ucs) table

       o  viewport configuration (vport) table

       o  drawing manager (dwgmgr) table (for future use)</pre>

    <pre>  3. blocks section - this section contains block definition entities

     describing the entities comprising each block in the drawing.</pre>

    <pre>  4. entities section - this section contains the drawing entities,

     including any block references.</pre>

    <pre>  5. end of file</pre>

    <pre>if you use dxfout's &quot;entities&quot; option, the resulting dxf file will contain

only the entities and end of file sections, and the entities section will

reflect only the objects you select for output.</pre>

    <pre>a dxf file is composed of a multiplicity of groups, each of which occupies

two lines in the dxf file.  the first line of a group is a group code,

which is a positive nonzero integer output in fortran &quot;i3&quot; format (that is,

right justified and blank filled in a three character field).  the second

line of the group is the group value, in a format which depends on the type

of the group as specified by the group code.



</pre>

    <pre>                                                                          3

&#12;autocad reference manual</pre>

    <pre>the specific assignment of group codes depends upon the item being

described in the file.  however, the type of the value this group supplies

is derived from the group code in the following way:</pre>

    <pre>                    group code range   following value

                          0 - 9       string

                         10 - 59      floating-point

                         60 - 79      integer

                        210 - 239     floating-point

                           999        comment (string)</pre>

    <pre>thus a program can easily read the value following a group code without

knowing the particular use of this group in an item in the file.  the

appearance of values in the dxf file is not affected by the setting of the

units command: coordinates are always represented as decimal (or possibly

scientific notation if very large) numbers, and angles are always repre-

sented in decimal degrees with zero degrees to the east of origin.</pre>

    <pre>variables, table entries, and entities are described by a group that intro-

duces the item, giving its type and/or name, followed by multiple groups

that supply the values associated with the item.  in addition, special

groups are used for file separators such as markers for the beginning and

end of sections, tables, and the file itself.</pre>

    <pre>entities, table entries, and file separators are always introduced with a 0

group code that is followed by a name describing the item.

</pre>

    <pre>c.1.3.2  group codes</pre>

    <pre>group codes are used both to indicate the type of the value of the group,

as explained above, and to indicate the general use of the group.  the spe-

cific function of the group code depends on the actual variable, table

item, or entity description.  this section indicates the general use of

groups, noting as &quot;(fixed)&quot; any that always have the same function.</pre>

    <pre>   group code                           value type

       0        identifies the start of an entity, table entry, or file

                separator.  the text value that follows indicates which.

       1        the primary text value for an entity.

       2        a name; attribute tag, block name, etc.

      3-4       other textual or name values.

       5        entity handle expressed as a hexadecimal string.

       6        line type name (fixed).

       7        text style name (fixed).

       8        layer name (fixed).

       9        variable name identifier (used only in header section of

                the dxf file).

       10       primary x coordinate (start point of a line or text

                entity, center of a circle, etc.).

     11-18      other x coordinates.

                                                             continued ...

</pre>

    <pre>4

&#12;                                   (c) drawing interchange and file formats</pre>

    <pre>   group code                           value type

       20       primary y coordinate.  2n values always correspond to 1n

                values and immediately follow them in the file.

     21-28      other y coordinates.

       30       primary z coordinate.  3n values always correspond to 1n

                and 2n values and immediately follow them in the file.

     31-37      other z coordinates.

       38       this entity's elevation if nonzero (fixed).  output only

                if system variable flatland is set to 1.

       39       this entity's thickness if nonzero (fixed).

     40-48      floating-point values (text height, scale factors, etc.).

       49       repeated value - multiple 49 groups may appear in one

                entity for variable length tables (such as the dash

                lengths in the ltype table).  a 7x group always appears

                before the first 49 group to specify the table length.

     50-58      angles.

       62       color number (fixed).

       66       &quot;entities follow&quot; flag (fixed).

     70-78      integer values, such as repeat counts, flag bits, or

                modes.

 210, 220, 230  x, y, and z components of extrusion direction.

      999       comments

</pre>

    <pre>c.1.4  comments</pre>

    <pre>the 999 group code indicates that the following line is a comment string.

dxfout does not currently include such groups in its output file, but dxfin

honors them and ignores the comments.  thus, you can use the 999 group to

include comments in a dxf file you've edited.  for example:</pre>

    <pre>    999

    this is a comment.

    999

    this is another comment.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -