2D Gateway Configuration
- Last UpdatedJul 14, 2025
- 13 minute read
When loading 2D files into AIM-A, the Gateways used may be configured by modifying certain known files. The areas covered by each file and how to modify the files are outlined below. For more information on loading these files, see Ingestion API Request Parameters.
Patterns 2D
This configuration applies to the contents of the following files:
-
AutoCAD: drawingfile-ac2d-patterns2d.xml
-
MicroStation: drawingfile-ms2d-patterns2d.xml
-
AVEVA P&ID: drawingfile-avevapid-patternmappingregex.xml
The Patterns2d configuration allows you to select, via Conditions, which type of graphical objects to amend so that tags can be associated or disassociated with graphical elements using the Group and Ungroup functions and add new Attributes to the grouped and ungrouped objects. The Patterns2d extension is similar to base mapping of engineering objects but allows transformations related to graphical objects.
It is possible to filter objects by attributes and associations kept in engineering data associated to graphical elements. Select types of graphical objects that will be grouped in the defined area around a selected object.
The following is the complete set of configuration settings supported by the Patterns2d extension:
<Patterns2d xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" guid="1c606204-2b64-4e39-927c-048892ca33f0" sourceProductName="AVEVA™ Gateway for 2D Data" componentName="Patterns2d" componentVersion="2.3.0.0.0" creationDate="2022-03-04" createdBy="[author]">
<Object>
<Conditions>
<ObjectType ObjectType="
symbol,
symbol_single,
symbol_single_textonly,
symbol_nested,
symbol_nested_textonly,
table,
dimension,
mleader,
mtext,
oval,
circle,
ellipse,
arc_closed,
arc_open,
all_lines_closed,
polyline_closed,
spline_closed,
region,
text,
line,
all_lines_open,
polyline_open,
spline_open,
point,
3dsolid,
leader,
fill"
/>
<Attribute Name="handle"
Value=".*" />
<Association Type="is a part of"
TargetAttributeName=".*"
TargetAttributeValue=".*" />
<Size min="0"
max="30" />
<NumberOfObjects min="1" max="80000" />
</Conditions>
<Group Separator="-" JoinTextFrom="topleft" IncludeParts="false" GrabTypes="
all,
symbol,symbol_single,
symbol_single_textonly,
symbol_nested,
symbol_nested_textonly,
table,
dimension,
mleader,
mtext,
oval,
circle,
ellipse,
arc_closed,
arc_open,
all_lines_closed,
polyline_closed,
spline_closed,
region,
text,
line,
all_lines_open,
polyline_open,
spline_open,
point,
3dsolid,
leader,
fill"
OrderByGroup="true"
KeepTextOnly="true" >
<IncludeArea allDirections="1.1"
top="0.6"
bottom="5.0"
right="1.5"
left="0.9"
/>
</Group>
<Attribute Name="grouped" Value="" />
<Attribute Special="ExtentCoordinates" />
<Ungroup KeepSingleSymbols="true" />
</Object>
</Patterns2d>
Graphical types from AutoCAD and MicroStation drawings are extracted as the following Patterns 2D types (for the purpose of grouping):
|
Patterns 2D type |
AutoCAD type (attribute) |
MicroStation type (attribute) |
|
text |
Text (text) |
Text (text) |
|
mtext |
MText (mtext) |
Node (mtext) |
|
symbol |
Block Reference (blockreference) Proxy (proxyentity) |
Cell (cell) Shared Cell (cell) Smart Solid (cell) Tagged object + Tags (cell) Complex Shape (complexshape) |
|
point |
Dot (point) |
Multi-Line (point) Line - zero length (point) |
|
line |
Line (line) MLine (line) |
Line (line) |
|
circle |
Circle (circle) |
Circle (circle) |
|
ellipse |
Ellipse (ellipse) |
Ellipse (ellipse) |
|
polyline |
Polyline (polyline) |
Complex Chain (polyline) |
|
arc |
Arc (arc) |
Arc (arc) |
|
spline |
Spline (spline) |
Bspline Curve (spline) |
|
region |
Region (region) |
Associative Region (region) Shape (region) |
|
table |
Table (table) |
Table (table) |
|
leader |
Leader (leader) |
|
|
mleader |
Multileader (mleader) |
Note (mleader) |
|
dimension |
Dimension - all types (dimension) |
Dimension (dimension) |
|
fill |
Hatch (hatch) |
Graphics with Fill set to Opaque or Outlined (hatch) |
|
3dsolid |
3DSolid (3dsolid) |
Conditions
Conditions: ObjectType, Attribute, Association, Size, NumberOfObjects.
Attribute and Association conditions can be used multiple times and ObjectType, Size, NumberOfObjects conditions can be used only once.
Due to Regular expressions used for Attribute and Association settings, specify multiple values to extend the range of selected objects.
When multiple criteria are used in a Condition only objects that satisfy all the criteria are selected for the subsequent actions.
The Patterns2d Conditions are as follows:
-
ObjectTypes: This is mandatory and allows selection by object type, where at least one type must be provided. Some keywords represent a few types:
-
all: all object types
-
symbol: symbol_single, symbol_single_textonly, symbol_nested, symbol_nested_textonly
-
symbol_single: symbol_single_textonly
-
symbol_nested: symbol_nested_textonly
-
oval: circle, ellipse, arc_closed
-
allLines_open: polyline_open, spline_open
-
allLines_closed: polyline_closed, spline_closed, region
Note: symbol is the generic term for a block reference, cell, symbol or shape, depending on the source system.
-
-
Attribute: (optional) Same condition as in Base Mapping.
-
Association: (optional) Same condition as in Base Mapping. Additionally, this parameter allows filtering by TargetAttributeName and/or TargetAttributeValue.
-
Size: (optional) Refers to size of the object in comparison to the drawing's size. Default =100 (%) values: from 0.0 to 100.0.
Specify the minimum and maximum (min and max) size of the objects that should be selected for grouping or ungrouping. Values provided denote the percent range within which a given object must fit in relation to the entire square area of the drawing.
For example: <Size min="3" max="10"/> means that objects whose rectangular area takes at least 3% and not more than 10% of the whole drawing area will take part in the selected action (Group or Ungroup).
-
NumberOfObjects: This parameter allows you to select graphical objects based on the number of elements. For example, if the ObjectType is mtext and NumberOfObjects has min ="3" and max ="3" then only tuplets (tags consisting of 3 lines) will be selected. (optional) default =1000000000, values: from 0 to 1000000000.
Grouping
-
Group: This action aggregates all the objects selected by the Conditions into a single grouped object with ObjectID formed from the concatenation of its text elements from the labels belonging to the objects included in this group. When a Group is created then regardless of what types of objects belong to that group, it contains only one tag and does not contain any child objects. This way of storing data is adjusted to rendering systems like Asset Information Management and will provide proper tagging and highlighting of tagged objects.
Note: The minimum number of objects in a Group is one single text object. A Group can contain any number of primitives. After an object is assigned to a Group, it won't be subject to any subsequent Group or Ungroup actions.
Settings
-
Separator: Any string. Default '-'. Used for concatenating text items into a common ID.
-
JoinTextFrom: Default: topleft. Used for setting from which direction text will be concatenated. Values:
-
top
-
bottom
-
right
-
left
-
topleft
-
topright
-
bottomleft
-
bottomright
Note: If the text is rotated from the horizontal it is first unrotated before the JoinTextFrom directions are applied. If grouped text objects are rotated from the horizontal and the maximum difference between all texts angles is less than 5%, then they are first unrotated before the JoinTextFrom directions are applied.
-
-
TextControlPoint: The order of concatenation is determined by the position defining the location of each text element. Values:
-
Center (Default)
-
Edges (which is the start position in X, Y of each text element).

-
-
IncludeParts: If set to true, then any object that is partly within the selected object's extents will be included in the group, otherwise, if false (default) only objects that are fully enclosed in the selected objects extents will be grouped.
-
GrabTypes: Filters which type of objects will be grouped together. The default is text and mtext and all other object types are allowed (see example above).
Objects of types selected for GrabTypes are collected into one tagged group.
Note: If there is no text object in the group, then the ID is not set, but objects are still grouped. Use Base mapping to tag these objects, therefore, it's best to apply Pattern2D mapping before Base mapping.
-
KeepTextOnly: If true, then regardless of what types of objects are selected by Conditions, GrabTypes and IncludeArea, only text objects are selected. This way of tagging can be useful in the systems where during selection only highlighting of the text is expected.
-
IncludeArea: Allows you to vary the search area of the object's extents by changing its overall size either symmetrically (if allDirections parameter is used) or in each orientation direction (if top, bottom, left or right is used, including combinations of these).
Examples:
-
allDirections=2.5
-
left=0.5 right=2.3 top=2.0 bottom=0.1
For example, left=0.5 and bottom=2.0 means searching for objects in 50% of horizontal length of the object (right-half of the original extent), additionally, this extent area will be extended into the bottom direction; and the vertical length will be extended to 200% of the original length.
-
When left+right<1.0 or top+bottom<1.0 or allDirections<0.5, then a configuration error is generated.
-
Therefore, the minimal settings will provide at least a single common point (allDirections=0.5) or a single line (right+left=1 or top+bottom=1), if IncludeParts="true", and will result in including all objects crossing that common point or that single line.

Note: By default, if the IncludeArea setting is not used, then all values are set to 0 for Object the types symbol, table, dimension, text, mtext, mleader; so only child objects that belong to the main object are grouped regardless of their location. You may include objects which do not belong to the main object by increasing values in the IncludeArea setting. This will add some objects placed within the main object's extent or also add some objects which are placed out of the main object's extent.
For the rest of the Object types that do not have any child objects, default value of IncludeArea parameter for each of these attributes is set to 1.0 (100%). This means grouping all child objects from the extent of the main object. This range can be reduced by using values less than 1.0 or can be extended by setting more than 1.0.
-
-
Attribute: Adds an attribute to a grouped object. Name is mandatory, Value is optional. Add any number of attributes, including attributes normally set in the Base mapping, such as ClassID.
-
Attribute Special="ExtentCoordinates": If specified, then the grouped object's extents are added as four attributes containing the coordinates of the minimum and maximum positions: #Xmin#, #Xmax#, #Ymin#, #Ymax#.
Ungrouping
-
Ungroup: Works in the opposite way to grouping by splitting structured data into smaller chunks so they can be used as single independent objects or single symbols, depending on the setting. It uses the same conditions for grouping but uses a different (shorter) list of objectTypes for filtering (only those objects having structure to ungroup):
-
symbol
-
symbol_Single
-
symbol_SIngle_TextOnly
-
symbol_Nested
-
symbol_Single_TextOnly
-
table
-
dimension
-
mtext
-
mleader
-
Settings:
-
KeepSingleSymbols: If this option is set to true, then symbols are not ungrouped completely to separate objects level but ungrouping stops when each symbol no longer contains any nested symbol. In other words, with this option all nested symbols are moved to the root level.
Notes:
-
This setting does not have an effect on other structured data that does not contain symbols.
-
Any number of Object nodes can be defined.
-
In each Object node, you only use a Group or Ungroup node but not both.
-
Do not group the same object twice.
-
If you ungrouped symbol_nested objects into multiple symbol_single objects, you must still use another Object node to ungroup symbol_single objects into separate primitives.
-
Using multiple Patterns2d extension configurations provide the same effect like using multiple Object nodes in one Patterns2d extension configuration.
-
Presentation Mapping
This configuration applies to the contents of the following files:
-
AutoCAD: drawingfile-ac2d-presentationmapping.xml
-
MicroStation: drawingfile-ms2d-presentationmapping.xml
-
AVEVA P&ID: drawingfile-avevapid-presentationmapping.xml
-
DEXPI: drawingfile-dexpi-presentationmapping.xml
Presentation Mapping configuration is used to adjust the output of SVG and EIWM properties, such as materials and colors. Use of the Presentation Mapping extension in the main Transform Configuration file is optional.
The following example shows all the parameters of the presentation mapping configuration.
Materials mapping
This section is used to map the material used in the model in AIM Dashboard. These values can then be used with the 2D Materials functionality in AIM Dashboard, for example, to highlight or hide all objects in the model that have the same material value. The syntax allows you to map any attribute to any toMaterial value.
<materials>
<material fromAttribute="ClassId" fromValue="Wall" toMaterial="Walls"/>
<!-- Other example expressions for setting 2D materials:
<material fromAttribute="ClassId" fromValue="OPENINGELEMENT" toMaterial="OPENINGS"/>
<material fromAttribute="ClassId" fromValue="DOOR" toMaterial="DOORS"/>
<material fromAttribute="ClassId" fromValue="WINDOW" toMaterial="WINDOWS"/>
-->
</materials>
Colors mapping
This section is used to model colors in AVEVA AIM Dashboard. The syntax contains two ways to map colors: fromAttribute and fromColor. It is possible to map colors from any attribute value, or from a specific color attribute value, to a toColor attribute.
-
The fromColor method maps the input color to a new color.
-
The following methods can affect the coloring used in Gateway renditions:
-
RGB, for example, 128, 0, 128.
-
Known colors (HTML color standard), for example, Red.
-
HTML hexadecimal: #E3D3D3.
-
-
Wildcard "*" in fromColor attribute to map all colors not affected by previous Color mapping items.
-
AutoCAD 2D DWG AutoCAD Color Index (ACI) mapping colors can be specified, for example, <color fromAttribute="autocad color index" fromValue="71" toColor="red"/>
-
MicroStation 2D DGN Color Table (DCT) mapping colors can be specified in the fromColor attribute in the format DCT<colorIndex>, for example, <color fromColor="DCT170" toColor="blue"/>.
<colours>
<colour fromAttribute="Name" fromValue="P100" toColour="green"/>
<!-- Other example expressions for custom colours changes:
<colour fromAttribute="ClassId" fromValue="PART" toColour="#008000"/>
<colour fromColour="magenta" toColour="130,100,130"/>
<colour fromColour="#455050" toColour="blue"/>
<colour fromColour="255,10,0" toColour="#F3F3F3"/>
-->
</colours>
Rescale 2D
This configuration applies to the contents of the following files:
-
AutoCAD: drawingfile-ac2d-rescale2dunitsdef.xml
-
MicroStation: drawingfile-ms2d-rescale2dunitsdef.xml
-
AVEVA P&ID: drawingfile-avevapid-rescale2dunitsdef.xml
-
DEXPI: drawingfile-dexpi-rescale2dunitsdef.xml
Scales factors – Rescale2dTransformation
Adjusting drawing, OLE object resolution and line thickness
The transformation extension Rescale2dTransformation enables you to scale the output SVG graphics. This may be needed when the drawing’s resolution is not matched to the resolution of the monitor or printer where the SVG will be viewed.
Scale resolution can be provided for three elements:
-
Drawing resolution: Rescales the entire drawing.
-
OLE resolution: Manipulates the resolution of embedded elements. This is applicable for both MicroStation and AutoCAD input files.
Limitation: Raster images in MicroStation drawings that are rotated are not rotated in the output SVG file.
-
Line resolution: Manipulates line thickness.
For Example:
<rescale2dTransformation guid="00000000-0000-0000-0000-000000000000" sourceProductName="AVEVA™ Gateway for 2D Data" componentName="Rescale2dTransformation" componentVersion="2.2.0.0.0" creationDate="1900-01-01" createdBy="[author]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<resize>
<drawingResolution factor="1.0" />
<OLEResolution factor="automatic" />
<lineResolution factor="2.5" type="text"/>
<lineResolution factor="automatic" type="lines"/>
</resize>
</rescale2dTransformation>
The three scale resolution elements are as follows:
-
<drawingResolution> (required): Rescales the drawing according to the factor. Default value is 1.0.
-
<OLEResolution> (optional): Manipulates the resolution of embedded objects, either explicitly by a numeric value or a value of automatic (default). The automatic mode derives the factor from the drawing resolution factor.
-
<lineResolution> (optional): Sets the line widths used for text and line types. They can be used together, for example, type="text|lines" as well as two separate line resolution settings. The factor value is used to multiply the line thickness. Only text lines generated as polylines (mapped from SHX fonts) are affected by this function and it is not applicable to TTF fonts from input files. When set to automatic (default), it derives the value from the drawing resolution factor.
When the drawing scale changes, the line scale will also change if both are set to be rescaled, for example you can use automatic for the line scale.
Note: SVG line thicknesses may be observed to be different when zoomed in compared to the original application view because they automatically update the line weight in real time. Rendering of SVGs does not have this feature, so thin lines appear to get thinner (or thicker) after zooming out (or in). In this case, automatic or manual line scaling in the Gateway can help to ensure the drawing content is still visible.
Text Modifications
This configuration applies to the contents of the following files:
AutoCAD:
-
drawingfile-ac2d-textmapping1.xml
-
drawingfile-ac2d-textmapping2.xml
MicroStation:
-
drawingfile-ms2d-textmapping.xml
AVEVA P&ID:
-
drawingfile-avevapid-textmapping1.xml
-
drawingfile-avevapid-textmapping2.xml
DEXPI
-
drawingfile-dexpi-textmapping1.xml
-
drawingfile-dexpi-textmapping2.xml
Manage Fonts
When viewing AutoCAD 2D drawings in the AIM Dashboard, if any font used in the drawing does not exist on the machine running the browser, then you may see representations of text and graphical objects that differ to that of the original drawing.
Consider the following examples:
-
Some text renders in a lighter color than the original drawing:

-
Some graphical objects are wrongly positioned:

-
Some text is wrongly encoded:

-
Some characters are wrongly positioned:

Such rendering issues can be improved by mapping the fonts involved. Font mapping can be performed in the drawingfile-ac2d-textmapping1.xml file. The following example modifications to the file must be added just before the end of the closing </fonts> element.
-
To map simprac.shx, romans.shx and romanc.shx to the AutoCAD 2D Gateway's default polylines and map all other .shx fonts to Tahoma.ttf.
<font from="^(?!simpfrac.shx$)(?!romans.shx$)(?!romanc.shx$).*.shx" to="Tahoma" regEx="true" />
-
If you don't want Romans and Romanc to map to polylines then replace the above line with this:
<font from="^(?!simpfrac.shx$).*.shx" to="Tahoma" regEx="true" />
-
To not map standard Windows ttf fonts but replace all others with Tahoma.ttf:
<font from="^(?!Arial$)(?!Arial Narrow$)(?!Arial Unicode MS$)(?!Calibri$)(?!Candara$)(?!Corbel$)(?!Consolas$)(?!Courier New$)(?!Lucida Sans Unicode$)(?! Microsoft Sans Serif$)(?!Segoe UI$)(?!Trebuchet MS$)(?!Verdana$).*.ttf" to="Tahoma" regEx="true" />
Text Mapping
This configuration applies to the contents of the following files:
This configuration applies to the contents of the following files:
AutoCAD:
-
drawingfile-ac2d-textmapping1.xml
-
drawingfile-ac2d-textmapping2.xml
MicroStation:
-
drawingfile-ms2d-textmapping.xml
AVEVA P&ID:
-
drawingfile-avevapid-textmapping1.xml
-
drawingfile-avevapid-textmapping2.xml
DEXPI
-
drawingfile-dexpi-textmapping1.xml
-
drawingfile-dexpi-textmapping2.xml
This section describes the transformation settings for manipulating the Text objects in the 2D Graphics.
Text Mapping is used in 2D drawings to customize textual objects visible in the drawing, either by varying the font that is used or mapping specific characters or text to alternative values.
Note: Unlike Base mapping, text mapping changes the displayed content of the output drawing.
Example of drawingfile-ac2d-textmapping1.xml and drawingfile-ms2d-textmapping.xml
<textMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
guid="00000000-0000-0000-0000-000000000000"
sourceProductName="AVEVA™ Gateway for 2D Data" componentName="TextMapping" componentVersion="1.0.0.0.0"
creationDate="2021-01-01" createdBy="[author]">
<texts>
<text from="1" to ="±" font="ANSI_SYMBOLS" />
<text from="%" to="^" font="*" regEx="false" />
<text from="colour" to="colour" font=".*" regEx="true" />
<text from="1024" to="0x400" font="*" />
<text from="0x400" to="1 kilo" font="*" />
</texts>
<fonts>
<font from="Courier" to ="Arial,Lucida Console" />
<font from="SansSerif" to="Lucida Console" italic="false" bold="true"/>
<font from="#missingFonts#" to="Consolas"/>
</fonts>
</textMapping>
Example of drawingfile-ac2d-textmapping2.xml
<textMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
guid="00000000-0000-0000-0000-000000000000"
sourceProductName="AVEVA™ Gateway for 2D Data" componentName="TextMapping" componentVersion="1.0.0.0.0"
creationDate="2021-01-01" createdBy="[author]">
<texts>
<text from="1" to ="±" font="ANSI_SYMBOLS" />
<text from="%" to="^" font="*" regEx="false" />
<text from="colour" to="colour" font=".*" regEx="true" />
<text from="1024" to="0x400" font="*" />
<text from="0x400" to="1 kilo" font="*" />
</texts>
<fonts>
<font from="Courier" to ="Arial,Lucida Console" />
<font from="SansSerif" to="Lucida Console" italic="false" bold="true"/>
<font from="#missingFonts#" to="Consolas"/>
</fonts>
</textMapping>
Note: When text for an imported file appears too faint, the text's appearance can be improved by applying a font mapping. Alternatively, adjust the Gamma value in the Toolbar when viewing the file in the Dashboard. This change is not stored permanently.
