📄 dxf 12 文件格式.htm
字号:
<html>
<head>
<title>file:///d:/程序资料/format2/dxf12.txt</title>
</head>
<body background="../jpg/di1.JPG">
<p align="center"><font size="5" color="#0000ff">drawing interchange and file formats
release 12</font></p>
<div align="center"><center>
<table border="0" width="80%">
<tr>
<td width="100%"><pre>copyright (c) 1982-1990, 1992 autodesk, inc. all rights reserved</pre>
<pre>autocad can be used by itself as a complete drawing editor. in some
applications, 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
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 and
then send the descriptions to a more powerful computer for finite-
element structural analysis. you can compute stresses and
displacements 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
compact format that changes significantly as new features are added
to autocad, 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 drawing
interchange file format (dxf) 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 specification
(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 the autocad internal format.
</pre>
<pre>ascii drawing interchange (dxf) files
*************************************</pre>
<pre>this section describes the autocad dxf (drawing interchange file)
format and the commands provided to read and write these files. dxf
files are standard ascii text files. they can easily be translated
to the formats of other cad systems or submitted to other programs
for specialized analysis. autocad can also produce or read a binary
form of the full dxf file. this feature is described in detail later
in this chapter.
</pre>
<pre>dxfout command - writing a dxf file
===================================
you can generate a drawing interchange file from an existing drawing
by means of the dxfout command:</pre>
<pre> command: dxfout </pre>
<pre>when autocad prompts you, respond with a filename or press 5 to
accept the default.</pre>
<pre>the default name for the output file is the same as that of the
current drawing, but with a file type of .dxf. if you specify an
explicit filename, you do not need to include a file type; .dxf is
assumed. if a file with the same name already exists, the existing
file is deleted. if you specify the file using a file dialogue box,
and a file with the same name already exists, autocad tells you;
allowing you to ok or cancel the deletion. next, dxfout asks what
precision 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 <6>:</pre>
<pre>the binary option is described later in this chapter.</pre>
<pre>if you respond with "entities" (or just "e"), dxfout asks you to
select the objects you want written to the dxf file. only the
objects you select are included in the output file - symbol tables
(including block definitions) will not be included. once you've
selected the desired objects, autocad again prompts you for the
numeric precision:</pre>
<pre> enter decimal places of accuracy (0 to 16)/binary <6>:
</pre>
<pre>dxfin command - loading a dxf file
==================================
a drawing interchange file can be converted into an autocad drawing
by means of the dxfin command:</pre>
<pre> command: dxfin </pre>
<pre>when autocad prompts you, respond with the name of the drawing
interchange file to be loaded.
</pre>
<pre>full dxfin
----------
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, dimension styles, named
views, named coordinate systems, or named viewport configurations
have been created.</pre>
<pre>note: if the drawing you are using as a prototype is not empty, you
might find it helpful to open a new drawing using the no
prototype... button of the create new drawing dialogue box, as
described in chapter 4 of the "autocad reference manual." you should
also be aware that some third-party applications include an acad.lsp
or .mnl file that modifies your drawing upon startup.</pre>
<pre>if any errors are detected during the input, the new drawing is
discarded. otherwise, an automatic zoom all is performed to set the
drawing extents.
</pre>
<pre>partial dxfin
-------------
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>auditing dxf files
------------------
to ensure that corrupt data is not imported into your drawing, you
can instruct autocad to perform an audit after importing dxf files
into your drawing with dxfin. when you use dxfin, the default action
is to perform no automatic auditing. to activate automatic auditing,
use the config command: </pre>
<pre> command: config</pre>
<pre>your current autocad configuration appears. press 5 to continue.
from the configuration menu select this option: </pre>
<pre> 7. configure operating parameters</pre>
<pre>from the operating parameter menu select this option: </pre>
<pre> 9. automatic audit after igesin, dxfin, or dxbin</pre>
<pre>answer y to this question: </pre>
<pre> do you want an automatic audit after igesin, dxfin, or dxbin?
<n>: y</pre>
<pre>return to the graphics screen by pressing 5 three times.</pre>
<pre>note: this kind of audit only displays the errors autocad finds; it
does not correct them. to correct problems, use the audit command on
the drawing while you are in autocad, or manually edit the dxf file.
</pre>
<pre>dxf file format
===============
this section describes the format of a dxf file in detail. it
contains technical information that you need only if you write your
own programs to process dxf files or work with entity information
obtained by certain autolisp and ads functions.</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 next.
</pre>
<pre>general file structure
----------------------
a drawing interchange file is simply an ascii text file with a file
type of .dxf 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 (see table 11-3 for a list of the
header variables).</pre>
<pre>2. tables section - this section contains definitions of named
items.</pre>
<pre> o linetype table (ltype)
o layer table (layer)
o text style table (style)
o view table (view)
o user coordinate system table (ucs)
o viewport configuration table (vport)
o dimension style table (dimstyle)
o application identification table (appid)</pre>
<pre>3. blocks section - this section contains block definition entities
describing the entities that make up 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 entities option, the resulting dxf file contains
only the entities section and the end of file marker, and the
entities section reflects only the objects you select for output.</pre>
<pre>note: if you select an insert entity, the corresponding block
definition is not included in the output file.</pre>
<pre>a dxf file is composed of many 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 i3 - that is,
right-justified and blank filled in a three-character field (the
exception to this is the four-digit extended entity data group
codes, which are output in fortran i4). the second line of the group
is the group value, in a format that depends on the type of group
specified by the group code. although dxfout output has a fixed
format, the dxfin format is free.</pre>
<pre>the specific assignment of group codes depends on 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>table 11-1. group code ranges
+================================+
| group code | following value |
| range | |
|-------------|------------------|
| 0 - 9 | string |
|-------------|------------------|
| 10 - 59 | floating-point |
|-------------|------------------|
| 60 - 79 | integer |
|-------------|------------------|
| 140 - 147 | floating-point |
|-------------|------------------|
| 170 - 175 | integer |
|-------------|------------------|
| 210 - 239 | floating-point |
|-------------|------------------|
| 999 | comment (string) |
|-------------|------------------|
| 1010 - 1059 | floating-point |
|-------------|------------------|
| 1060 - 1079 | integer |
|-------------|------------------|
| 1000 - 1009 | 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 represented in decimal degrees with zero
degrees to the east of origin.</pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -