Attribute Mapping
- Last UpdatedMay 12, 2025
- 8 minute read
Attribute Mapping determines how attributes from the source system are transformed to match the requirement of the target system. For each attribute from the source system, each mapping entry is examined to determine whether the attribute matches.
Note: The attribute qualifier is required in attribute mapping entries. You may specify a pattern property to match only attributes with a value that conforms to the regular expression.
Attribute mapping entries permit the following Values to be specified:
-
Conditions to match
-
Name of the attribute
-
Value of the attribute
-
Units of the attribute
A sample Attribute mapping example is as follows:
<Object>
...
<Attributes>
<Attribute>
<Name value="XYZ" />
<Value value="ABC" />
</Attribute>
</Attributes>
...
</Object>
Attribute Mapping entries can be broadly classified into the following:
Create:
The simplest form of attribute mapping entry to create a new attribute is shown below:
<Object>
...
<Attributes>
<Attribute>
<Name value="Identifier" />
<Value value="[Tag]" />
</Attribute>
</Attributes>
...
</Object>
This mapping entry adds a new attribute named Identifier to the source system. The attribute value is taken directly from the value of the Tag attribute from the source system.
The attribute mapping entry to create a new attribute matching a simple condition, is shown below:
<Object>
...
<Attributes>
<Attribute name="Tag" pattern="^[A-Za-z]+$" >
<Name value="Identifier" />
<Value value="[Tag]" />
</Attribute>
<Attributes>
...
</Object>
This mapping entry indicates that for all the objects matching the condition, if the Tag attribute in the source system is present, then a new attribute named Identifier is added. The attribute value is taken directly from the value of the Tag attribute from the source system.
The attribute mapping entry to create a new attribute taking multiple attributes with their corresponding patterns to match specific format is shown below:
<Object>
...
<Attributes>
<Attribute>
<Conditions>
<Attribute name="ClassName" pattern="Window" />
<Attribute name="SubType" pattern="Solid" />
</Conditions>
<Name value="Type" />
<Value value="[SubType] [ClassName]">
<Transforms>
<Replace pattern="\d{2}" value="yyy" />
</Transforms>
</Value>
<Units value="psi" />
</Attribute>
</Attributes>
...
</Object>
You may use a lookup to obtain the attribute value. You may use transforms to modify
the attribute value from the source system.
Transforms may be combined with a lookup, in which case the transform is applied to the source value and the resulting value is passed to lookup:
<Object>
...
<Attributes>
<Attribute name="Tag" pattern="^[A-Za-z]+$" >
<Name value="Identifier" />
<Value value="[Tag]">
<Transforms>
<Replace pattern="\d{2}" value="yyy" />
</Transforms>
<Lookup Id="Attribute Value Map" >
<FailAction action = "FixedValue" value="[Name]" />
</Lookup>
</Value>
</Attribute>
</Attributes>
...
</Object>
Update:
The simplest form of attribute mapping entry is to update an existing attribute:
<Object>
...
<Attributes>
<Attribute name="Tag" pattern="^[A-Za-z]+$" >
<Value value="abcdef123" />
<!-- One can do transform or lookup here on the value if required -->
</Attribute>
</Attributes>
...
</Object>
This mapping entry indicates that for all the objects matching the condition, the Tag attribute in the source system, if present and matching the pattern then, the attribute value of Tag is fixed to abcdef123.
<Object>
...
<Attributes>
<Attribute name="Tag">
<Value value="ID#[Tag]" />
<!-- One can do transform or lookup here on the value if required -->
</Attribute>
</Attributes>
...
</Object>
This mapping entry indicates that for all the objects matching the condition, the Tag attribute in the source system, if present, then the attribute value of Tag is prefixed with the text ID#.
Attributes from associated objects can also be used, as shown below:
<Object>
<IncludeAssociatedObjectAttributes type = "^FillsVoids$" refID = "[Tag] " >
<Conditions>
<Attribute name = "ClassName" pattern = "^OPENINGELEMENT" />
<Attribute name = "Name" pattern = "^element1$" />
</Conditions>
</IncludeAssociatedObjectAttributes>
<Attributes >
<Attribute name="Tag" pattern="^[A-Za-z]+$" >
<Name value="Identifier" />
<Value value="[Tag] [associated:Tag]" />
</Attribute>
</Attributes>
...
</Object>
In the above case, the value of the Tag attribute along with the value of Tag of the first associated object matching the condition is used to derive the attribute value. You must use the prefix "associated:" to resolve the value from its associated objects.
<Object>
...
<IncludeAssociatedObjectAttributes type ="^FillsVoids$" refID = "[associated:Tag]" >
<Conditions>
<Attribute name = "ClassName" pattern = "^OPENINGELEMENT" />
<Attribute name = "Name" pattern = "^element1$" />
</Conditions>
</IncludeAssociatedObjectAttributes>
<Attributes >
<Attribute>
<Name value="Identifier" />
<Value value="[associated:Tag]" appendSeparator=";" />
</Attribute>
</Attributes>
...
</Object>
When there is more than one associated object with a Tag attribute and you need to include all of them, all these values can be aggregated into a single symbol-separated list value. In the above case, the value of the attribute Tag present in all associated objects matching the condition is used to derive the attribute Identifier value. All the values are joined using the separator string ";" defined by appendSeparator. You must use the prefix "associated:" to resolve the value from its associated objects.
The following example supports the case when there are associated object attributes more than one descendant level below the main object.
<Object>
...
<Conditions>
<Attribute name = "ClassName" pattern = "^DOOR$" />
</Conditions>
<TemplateID id ="default" />
<ObjectID value="[GlobalId]" />
<IncludeAssociatedObjectAttributes type = "^Materials$" refID = "[associated{descendantLevel=2}:Name] ">
<Conditions>
<Attribute name = "ClassName" pattern = "^MATERIAL$" />
</Conditions>
</IncludeAssociatedObjectAttributes>
<Attributes>
<Attribute>
<Name value="Materials" />
<Value value="[associated{descendantLevel=2}:Name]" appendSeparator=";" />
</Attribute>
</Attributes>
...
</Object>
In the above case, the material values are in Material objects located two levels down in the object hierarchy: DOOR is associated (via the inverse relationship RELASSOCIATESMATERIAL) with MATERIALLIST, which is directly associated with two MATERIAL objects. You must therefore use the prefix "associated{descendantLevel=<level>}:" to resolve the value from its associated objects that are specified to a certain level in the object hierarchy. All of these values are joined using the separator string ";" defined by appendSeparator.
Remove:
The simplest form of an attribute mapping entry to remove an existing attribute is shown below:
The following mapping entry removes the attribute Tag from an object, if the attribute Tag is present in the source system.
<Object>
...
<Attributes>
<Attribute name="Tag" >
<Remove />
</Attribute>
</Attributes>
...
</Object>
The following mapping entry removes the attribute Tag from an object, if the attribute Tag is present in the source system and also matches the pattern.
<Object>
...
<Attributes>
<Attribute name="Tag" pattern="^[A-Za-z0-9]+$" >
<Remove />
</Attribute>
</Attributes>
...
</Object>
The following mapping entry removes all the attributes matching the pattern from an object.
<Object>
...
<Attributes>
<Attribute name="*" pattern="^[A-Za-z0-9]+$" >
<Remove />
</Attribute>
The following mapping entry removes all the attributes present in an object.
<Object>
...
<Attributes>
<Attribute name="*" >
<Remove />
</Attribute>
...
</Object>
keepUnmappedAttributes
This setting determines whether attributes that are not matched are included in the output EIWM file.
If this setting is true, then all the attributes are included in the output EIWM file.
If this setting is false, then only those attributes that have a matching mapping entry are included in the output EIWM file.
<Object>
...
<Attributes keepUnmappedAttributes="true">
<Attribute name="Tag">
<Value value="ID#[Tag]" />
</Attribute>
</Attributes>
...
</Object>
Notes:
-
The keepUnmappedAttributes setting is optional. By default, the keepUnmappedAttributes attribute value is true if the setting is not provided.
-
The following attributes are included in the EIWM file regardless of their mapping or of the value of keepUnmappedAttributes attribute being set to false:
-
GlobalID
-
Name
-
ObjectID
-
ObjectName
-
ClassID
-
Context
-
RevisionID
-
TemplateID
-
IncidentalClassification
-
When only the path is set in the Input Locator field, then all the DWG/DXF files present in the top folder and sub-folders will be processed. If any DWG/DXF files contain internal references (XREF) to other DWG/DXF files, then they will automatically be included in the processing of the main DWG/DXF file. Therefore, if referenced files are placed in the same folder or sub-folders of the folder path selected for processing, then they may be processed more than once, for example, as a referenced file and as an individual file. This can be prevented by either ensuring all referenced files are not located in the input root folder or its sub-folders or by processing each specific DWG/DXF file representing the model as a single file in the input locator rather than setting it to the folder pathname.
DWG objects are read with all their internal information. This information is attached directly to these objects as attributes:
-
Attribute name for AutoCAD handle: "handle"
-
Attribute name for AutoCAD parent handle: "parent handle"
-
Attribute name for AutoCAD layer: "layer"
-
Attribute name for AutoCAD block name: "block name"
-
Attribute name for AutoCAD object's type: "autocad type"
-
Attribute name for main and each referenced ("XRefs") AutoCAD models: "#MODEL_NAME#"
Each of these attributes can be used for tagging or classification of objects.
When objects are extracted from reference files, the value of the #MODEL_NAME# parameter is set to the name of the reference file. If relevant, this name can then be used to define the object’s ID.
<Object>
...
<Conditions>
<Attribute name="#MODEL_NAME#" />
</Conditions>
<ObjectID value = "[#MODEL_NAME#]"/>
<ClassID value = "Equipment"/>
<ContextID value="Avngate|XREF" />
...
</Object>
The "MODEL_NAME" attribute is used to set the tag (ObjectID) for all objects according to their source DWG file name. Additionally, the ContextID attribute is set with a nested name "XREF" to ensure uniqueness and it differentiates the main model’s object tag from its child objects’ tags.
DWG objects may have additionally associated two types of attributes:
-
block attributes which can be attached only to objects of type "block reference".
-
attributes represented by extended object data (XData) which can be attached to any kind of objects.
After reading this data from DWG, both groups of attributes are instantiated as two separate objects with attributes and are attached to main DWG object. DWG object refers to these objects by association of type: "has dataset".
Each object read from DWG has set Handle attribute; so objects created for keeping the additional attributes have always set Handle attributes with values, respectively: "block dataset of <internal object handle>" or "XData dataset of <internal object handle>".
To export them to EIWM XML these objects representing groups of attributes (datasets) must be tagged by setting "ObjectID" attribute value and classified by setting "ClassID" attribute.
The following example first creates two new attributes: "ObjectID" and "ClassID" for both dataset objects and as a result they will appear in AIM. Last section of the mapping creates "ObjectID" and "ClassID" for each main DWG object which has associated dataset object.
<!-- Set tag and classify Datasets created from block's attributes -->
<Object>
...
<Conditions>
<Attribute name="Handle" pattern=".*block dataset of.*" />
</Conditions>
<ObjectID value = "[handle]"/>
<ClassID value = "Equipment"/>
...
</Object>
<!-- Set tag and classify Datasets created from XData -->
<Object>
...
<Conditions>
<Attribute name="Handle" pattern=".*XData dataset of.*" />
</Conditions>
<ObjectID value = "[handle]"/>
<ClassID value = "Equipment"/>
...
</Object>
<!-- Set tag and classify objects -->
<Object>
...
<IncludeAssociatedObjectAttributestype="has dataset" refID = "[associated:Tag]" " [associated:Type]" />
<Conditions>
<Attribute name = "Tag" />
</Conditions>
</IncludeAssociatedObjectAttributes>
<ObjectID value = "[associated:Tag]"/>
<ClassID value="[associated:Type]" />
...
</Object>
In these cases "ClassID" attribute is created with constant values "Equipment".
"ObjectID" attribute is created with the value taken from attribute Handle.
Main DWG object has "ObjectID" and "ClassID" attributes created with values taken from one of the associated dataset which contains attributes names "Tag" and "Type".
Excluding Objects from Output Files
You can add the following special attributes to specific objects to exclude them from the various output files:
-
#EXCLUDE_FROM_EIWM# - excludes the objects from the EIWM file (but not associations to those objects from other objects).
-
#EXCLUDE_FROM_CSV# - excludes the objects from CSV files, both CSV reports and CSV load files.
-
#EXCLUDE_DOCUMENT_ASSOCIATIONS# - excludes the references to Document objects (usually represented by 'is referenced in' associations) in the EIWM file.
-
#EXCLUDE_FROM_XGL# - excludes the object's hotspot (SELECTIONID) tagging information from XGL/ZGL the file, if produced.
It's possible to create multiple EXCLUDE attributes of different types on the same object to exclude it from the relevant multiple output files. If you do not want the EXCLUDE attribute for one type of output file appearing as an attribute in another type of output file, then set the attribute's system parameter to "true".
For example, the following configuration will exclude from a CSV file all objects that do not have a Class ID defined and the #EXCLUDE_FROM_CSV# attribute won't be included in the EIWM file:
<Object>
<Conditions>
<Attribute name="ClassID" pattern="" />
</Conditions>
<Attributes>
<Attribute system="true" >
<Name value="#EXCLUDE_FROM_CSV#"/>
<Value value=""/>
</Attribute>
</Attributes>
</Object>