Writer Directives
This section describes the directives the AutoCAD Map 3D Object Data Writer module recognizes. Each of the directives is prefixed by the current <WriterKeyword>_ when they are placed in a mapping file. By default, the <WriterKeyword> for the AutoCAD Map 3D Object Data Writer is the same as the <WriterType>.The following directives are all used by the AutoCAD Map 3D Object Data Writer.
All AutoCAD RealDWG Writer directives can be used by the AutoCAD Map 3D Object Data Writer. In addition to these directives, the AutoCAD Map 3D Object Data Writer introduces some new directives not used by the AutoCAD RealDWG Writer.
DATASET
The dataset into which feature data is to be written.
Required/Optional
Required
Workbench Parameter
Destination Autodesk AutoCAD Map 3D Object Data File
VERSION
The version of AutoCAD DWG/DXF file to be produced. The value corresponds with the release number of the AutoCAD DWG/DXF file that is produced.
Required/Optional
Required
Values
- Release14
- Release2000
- Release2004
- Release2007
- Release2010
- Release2013 (default value)
Example
The example statement below instructs the AutoCAD Map 3D Object Data writer to produce a release 14 AutoCAD DWG/DXF file:
AUTOCAD_OD_VERSION Release14
Workbench Parameter
AutoCAD Version
TEMPLATEFILE
Required/Optional: Optional
This statement specifies the name of the existing AutoCAD DXF or DWG file that contains linetype, layer, shape header, block definitions and a codepage to be copied to the destination AutoCAD file. Any object data tables in the template file will not be copied. Some AutoCAD users also refer to this as a prototype file. This is an optional parameter. If the parameter is not defined, then the output file uses the linetype defined in the mapping file along with the predefined type of CONTINUOUS which is always present in an AutoCAD DWG/DXF drawing.
Note: Tip: LINETYPE definitions found in the mapping file override any linetype definitions found in the template file. The template file can also be used to set the codepage of the resulting AutoCAD DWG/DXF file.
Note:
- Since object data tables are not copied from the template file, but block definitions are, the block definitions that are copied will have any related object data removed. It follows that in an AutoCAD-to-AutoCAD translation, if insert entities in the source dataset are not exploded, no object data on the entity parts of those inserts will be stored on them in the destination dataset. Use of the APPEND_TO_TEMPLATEFILE directive may affect the handling of entities and object data tables found in the template file. Please reference it more information.
The example below specifies that the file called c:\tmp\test.dwg contains the block, layer, shape header definitions, and linetype definitions for the output dataset.
AUTOCAD_OD_TEMPLATEFILE c:/tmp/test.dwg
Note: Tip: Many AutoCAD users refer to the template files as prototype files.
Workbench Parameter
Template File
DEF
It is important to note that the AutoCAD Map 3D Object Data Writer makes use of destination DEF lines in the FME mapping file in a different way than the AutoCAD RealDWG Writer. In the AutoCAD Map 3D Object Data Writer, DEF lines without user attributes are treated as layer definitions, while any DEF lines with user attributes are treated as object data table definitions where each attribute will become a column.
Not only does the AutoCAD Map 3D Object Data Writer require that every feature written to the AutoCAD DWG/DXF file be stored within a defined layer, all object data information must be stored within a defined object data table. In AutoCAD DWG/DXF drawings, the layers are used to store collections of logically related attributes, and the object data tables are used to associate additional information with the entities stored on those layers.
Within the FME, layers and object data tables are both made from FME feature types. An FME feature with a feature type that defines an object data table may write both entity and object data information to the output file, and may dynamically create a layer for the entity information if necessary. An FME feature with a feature type that defines a layer will only write entity information to the output file.
The order of properties in the DEF line statement is required as shown, though additional attribute name and type pairs may be in any order. The DEF line statement is of the following form:
<WriterKeyword>_DEF <def line name> \ autocad_color <default color> \ autocad_linetype <default linetype> \ [autocad_layer_frozen no] \ [autocad_layer_hidden no] \ [autocad_layer_locked no] \ [autocad_layer_on yes] \ [autocad_layer_desc <layer description>] [autocad_od_entity_key_attr autocad_od_entity_key] \ [<attribute name> <attribute type>]
where:
- <def line name> is the name of the layer being defined if the DEF line contains no user attributes. If the DEF line contains user attributes def line name is the name of the object data table being defined. This is the name which is used throughout the remainder of the FME mapping files. The def line name cannot be empty.
- <default color> is the color number used for all features stored within the layer unless explicitly overridden on the correlation lines below. Valid values are between 1 and 255.
- <default linetype> is the name of the linetype to use for the layer if no linetype is specified on the correlation line. The linetype specified must either be:
- defined in the mapping file,
- copied from a specified template file, or
- the predefined linetype named CONTINUOUS.
- <autocad_layer_frozen> is the frozen state of the layer to create. If specified, then the created layer is frozen; otherwise, the layer is not frozen.
- <autocad_layer_hidden> is the hidden state of the layer to create. If specified, then the created layer is hidden; otherwise, the layer is not hidden.
- <autocad_layer_locked> is the locked state of the layer to create. If specified, then the created layer is locked; otherwise, the layer is not locked.
- <autocad_layer_on> can be set to yes to create a layer as on; otherwise, the layer is created as off. Layers which are off are still read by the AutoCAD Reader
- <autocad_layer_desc> can be set to provide a description string for a layer; otherwise the layer is created with no description.
- <autocad_od_entity_key> is the name of an attribute which will be checked for entity key values while writing. Each unique entity key value represents a single AutoCAD entity with which to associate feature geometry and attributes.
- <attribute name> <attribute type> is the definition of an attribute to be stored within the object data table. The presence of these attributes define this DEF line as an object data table definition instead of a layer definition. The attributes will define the columns in the output object data table. For additional information on the DEF directive, see the AutoCAD DWG/DXF documentation.
The example below defines a layer called boundary in which entities are drawn using color 13 (unless otherwise specified) and a linetype called dash-dot (unless otherwise specified).
AUTOCAD_OD_DEF boundary \ autocad_color 13 \ autocad_linetype dash-dot
The example below defines an object data table called boundary_info with columns named FEATCODE, PPID, DATECHNG and SURVEYDIST. Attributes will be written as records for each feature within the object data table definition. The entity information for features within this object data table definition will still be written to a layer. See the autocad_layer attribute.
AUTOCAD_OD_DEF boundary_info \ autocad_color 13 \ autocad_linetype dash-dot \ autocad_od_entity_key_attr autocad_od_entity_key \ FEATCODE char(12) \ PPID char(10) \ DATECHNG date \ SURVEYDIST number(8,2)
Required/Optional
Required
APPEND_TO_TEMPLATEFILE
This directive can be used to allow the file specified by the DATASET directive to be written as the concatenation of the full contents of the file specified by the TEMPLATEFILE directive with all written data. By default it is set to NO, so the template file (if one is specified) is only used for header information but not existing data. If this directive is set to YES then the full header and data information is used from the template file.
Notes:
- When this directive is set to YES, then object data tables will be copied from the template file, unlike the general case of template file use. This copying also implies that there may be name conflicts between object data tables to be written from DEF lines, and object data tables which already exist in the template file. When such conflicts occur, the existing template file table definition and all of its columns and properties will exclusively be used. This behavior comes with the requirement that all object data attributes on features to be written, need to be unique in a case-insensitive comparison.
- When appending object data to the template file, a feature with an autocad_entity attribute with a value of autocad_od_table, will have the value of its autocad_od_entity_key attribute checked against the handles of entities which exist in the template file. If it is found to match, the attributes of the feature will be written as object data associated with the entity found. This may potentially associate object data with existing entities in the template file unintentionally if the entity key range of the autocad_od_table features overlaps the range of entities in the template file.
Required/Optional
Optional
Values
YES | NO (default)
Workbench Parameter
Append Data to Template File
BLOCK_OBJECT_DATA_STORAGE
This directive can be used specify how an FME feature with composite geometry such as those with fme_geometry type of fme_aggregate or fme_donut, will store its attribute information as object data. A value of “Insert” indicates that object data will only be stored on the insert entity (block reference) that will be created from the composite geometry. A value of “All” indicates that copies of the object data will be stored on the insert as well as on every entity part that is created within the block definition. “All” is a good option if the insert will later be exploded into parts and object data is desired on each part.
Required/Optional
Optional
Note: In an AutoCAD-to-AutoCAD translation, if insert entities in the source dataset are not exploded, this directive is not applicable to that insert data, because it is not stored as FME features with composite geometry.
Values
Insert (default) | All
Workbench Parameter
Write block object data to