Autodesk AutoCAD的DWG / DXF阅读器/写入器

This format contains Autodesk®RealDWG by Autodesk, Inc.1版权所有©1998-2006欧特克公司版权所有。

This chapter is about the AutoCAD DWG/DXF reader/writer and AutoCAD feature types supported by FME.For AutoCAD DWF information, please refer to theAutodesk盟toCAD DWF Reader/Writer.

FME can read and write files used by Autodesk®AutoCAD®and compatible systems.AutoCAD drawing files consist of drawing settings and configuration, as well as a series of entities, or graphic elements, organized into layers.

FME provides broad support for many AutoCAD entity types and options.FME reads and writes AutoCAD file versions up to and including 2020.

When AutoCAD data is output, header information may be copied from a supplied template, or prototype, file.

Reader Overview

The AutoCAD reader first reads the header and table information from the drawing file being processed, and caches information on blocks, shape files, layers, linetypes, and applications.These cached values are referenced by entities throughout the file and are needed when processing the entities.

The reader then extracts entities, one at a time, from the entity section of the drawing file and passes them on to the rest of FME for processing.Complex entities such as polylines and inserts are extracted as single FME features.If the entity has attribution stored as extended entity data, then this is also read and placed in the feature.

When the AutoCAD reader encounters an entity type it does not know how to process, it simply sets the entity type of the feature and returns it.This feature is then logged by the FME correlation subsystem and the reader moves on to the next entity.

The AutoCAD reader consists of Source Autodesk AutoCAD DWG/DXF File(s).

Writer Overview

The AutoCAD writer provides the following capabilities when writing AutoCAD files.

  • 用户定义的线型:New linetypes can be defined in the workspace.These linetypes can then be referenced by features being written to the AutoCAD file.
  • 用户定义的层:Users must define the layers into which features are stored.The layers can also define the attributes to be stored within the feature.
  • 复制块定义:Often users have existing AutoCAD drawing files that contain block definitions they want the translated data to carry.Specifying the模板文件parameter results in block definitions being copied from the existing file to the output DWG/DXF file.These blocks can then be referred to by insert entities.
  • 复制线型:Predefined linetypes within existing DWG/DXF files are copied making them available for use by features being written to the destination file.Specifying the模板文件parameter in the mapping file results in the predefined linetypes being copied from the template file to the output drawing file.Feature entities can then refer to these linetype definitions.
  • 复制图层定义:Layer definitions within an existing DWG/DXF file identified by模板文件parameter enable layer definitions to be copied to the destination data set and then referenced.
  • 形状复制头的定义:Shape header definitions are also copied from the file specified by the模板文件parameter.
  • 自动块创建:When a feature is passed to the writer that cannot be written as a single AutoCAD entity, such as a donut polygon, the writer automatically defines an AutoCAD block and inserts entities necessary to represent the feature.If a block is already defined with that name, either through previous block creation or through existence in the template file, then the existing block definition will be used and the multi-part feature will be added at an insert point calculated from the feature geometry.If theautocad_block_insert_ [XYZ]attributes are specified, they will be used to specify an insert point for the new block reference.
  • 多版本支持:The AutoCAD DWG/DXF writer supports files that are compatible with any current AutoCAD release.
  • 灵活的属性支持:Attribute information can be written through the use of theautocad_attributesattribute being set as shown in the following table.

autocad_attributes值

描述

extended_entity_data

这导致归属被写入的功能扩展实体。

insert_attributes

这导致作家创造每个功能插入实体和存储与插入实体的所有属性。插入件实体指的是包含输出要素的几何形状的块。

external_attributes

这是默认值。有限的属性被写入AutoCAD文件。如果被存储在外部数据库中的属性,这是有用的。需要注意的是列表格式由AutoCAD的读者创建扩展实体数据可能仍然被写入。

When creating AutoCAD files, the AutoCAD writer first defines the linetypes and layers defined within the workspace.The writer then reads in a template file, if specified, and copies the linetypes, layer definitions, shape file header information, and block information from the template file to the output dataset.

The AutoCAD writer then outputs each feature it is given to the output file in the appropriate entity type.

When writing an AutoCAD file, the format of file output is determined as follows:

  • If the file name contains的.dwgor.DWG, then the output dataset is written in the ACAD format.
  • If the file name contains.DXFor.DXF,then the output dataset is written in DXF format.
  • If an error exists in the workspace, the translation is halted.
  • 扩展记录数据的支持:目前AutoCAD的DWG / DXF writer支持写入实体的扩展字典创建扩展记录书写的。

The AutoCAD writer uses the above rules to enable the same underlying FME mapping file to be used to create both DXF and DWG output files.Users can specify their choice simply by changing the suffix of the output file being produced.