Writer Directives

This section describes the directives the Esri MSC 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 Esri MSC Writer is the same as the <WriterType>.

All AutoCAD DWG/DXF Writer directives can also be used by the Esri MSC Writer. In addition to these directives, the Esri MSC Writer introduces some new directives not used by the AutoCAD DWG/DXF Writer.

DATASET

Required/Optional: Required

The dataset into which feature data is to be written.

Workbench Parameter: Destination AutoCAD File

TEMPLATEFILE

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 MSC feature classes 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 drawing.

Note: 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 file.

Note: Since MSC feature classes are not copied from the template file, but block definitions are, the block definitions that are copied will have any related MSC data removed. It follows that in an AutoCAD to AutoCAD translation, if insert entities in the source dataset are not exploded, no MSC data on the entity parts of those inserts will be stored on them in the destination dataset.

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.

ESRIMSD_TEMPLATEFILE c:/tmp/test.dwg

Note: Many AutoCAD users refer to the template files as prototype files.

Required/Optional

Optional

Workbench Parameter

Template File

DEF

It is important to note that the Esri MSC Writer makes use of destination DEF lines in the FME mapping file in a different way than the AutoCAD DWG/DXF Writer. In the Esri MSC Writer DEF lines are treated as MSC feature class definitions where each attribute will become a part of the feature class attribute schema.

Not only does the Esri MSC Writer require that every feature written to the destination AutoCAD file be stored within a defined AutoCAD layer, all MSC information must be stored within defined MSC feature classes and entities. In AutoCAD files, the layers are used to store collections of logically related attributes, and the MSC feature classes store schema information used to associate additional information with a selection of entities stored on those layers.

Within the FME, MSC feature classes are made from FME feature types. An FME feature may write both entity and MSC information to the output file, and may dynamically create a layer for the entity information if necessary.

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  <feature class name> \
	autocad_color <default color> \
	autocad_linetype <default linetype> \
	msd_type <MSC geometry type> \
	[autocad_layer_type frozen] \
	[<attribute name> <attribute type>]

where:

  • <feature class name> is the name of both the layer and the MSC feature class being defined. This is the name which is used throughout the remainder of the FME mapping files. The feature class 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.
  • <msd_type> is the geometry type of the MSC feature class to be created from this DEF line. Valid values include msd_point, msd_polyline, msd_polygon, msd_multipatch, and msd_annotation.
  • <autocad_layer_type> is the type of layer to create. Currently, only the value frozen is supported. If specified, then the created layer is frozen; otherwise, the layer is not frozen.
  • <attribute name> <attribute type> is the definition of an attribute to be stored within the MSC feature class. The attributes will define the attribute names and types in the output feature class. For additional information on the DEF directive, see AutoCAD DWG/DXF documentation. The values for <attribute type> are the same as those for Esri Shapefiles.

The example below defines an MSC feature class called boundary with definitions of attributes named FEATCODE, PPID, DATECHNG and SURVEYDIST. Attributes will be written as MSC attributes on each entity whose feature type is this feature class name. The entity information for each feature with this feature type will still be written to a layer also called boundary. This layer is defined to store entities of color 13 (unless otherwise specified) and of a linetype called dash-dot (unless otherwise specified). See the autocad_layer attribute.

ESRIMSD_DEF boundary_info \
	autocad_color 13 \
	autocad_linetype dash-dot \
	msd_type msd_polyline \
	FEATCODE char(12) \
	PPID char(10) \
	DATECHNG date \
	SURVEYDIST number(8,2)

Required/Optional

Optional