Tags

Elements in a design file may have user-defined attributes attached to them. Such attributes are called tags, and these may be read and written (DGNV8 only) by FME. In addition, to supply a value for a user-defined attribute, tags may also be displayed as text in the original design file. The TAGS_AS_TEXT directive Output Tags as Text Workbench reader parameter controls whether or not tag data elements will be returned as text elements.

When reading a design file, FME first scans for all the tag data elements and tag set definition elements. Then as it reads each graphical element from the design file, it uses the element association ID to reconnect the data and attribute names with the graphical element. All the tag data values are then added to the feature returned into FME.

The attributes shown in the following table are added to an element for each associated tag.

Note: <tag name> is replaced by each TAG NAME that may be associated with the element. For example, if the element is associated with tags called "NUMLANES" and "PAVETYPE", then the feature would have attributes like "NUMLANES", NUMLANES.height, PAVETYPE, PAVETYPE.rotation, etc.

Note that most of the tag attributes are same as those of text. For example, igds_tag_names{}.height is the same as igds_text_height and is therefore not explicitly documented. All the other tag attributes are documented as follows:

Note: Since tags from multiple tagsets may be attached to a single element, there may be multiple tags with the same name. In this case, the reader will rename the tags to make them unique. The original tag name is stored in the <tag name>.name attribute.

Attribute Name

Contents

igds_tag_names{}

List of tag names attached to an element.

Default: No default

Required when writing tags through list attributes.

<tag name>.tagset_name

The name of the tagset the tag belongs to.

Default: No default

Required when writing tags to DGNV8

<tag name>.tagtype

The unique tag id

Default: 1

Range:

1 = tag of type character string

3 = tag of type integer

4 = tag of type double

Optional when writing tags to DGNV8. In case tagtype is not provided, it always defaults to character string (i.e., type 1).

<tag name>.name

The name of a tag. Though the tag name is part of the attribute name, the tag may be renamed. This stores the original name from the tagset when reading, and represents the name of the tag that is created when writing.

Default: No default

Optional when writing tags to DGNV8

<tag name>.value

The value of a tag when reading. This is the same value stored in the attribute <tag name>, when reading. When writing, this is used to create the value of a tag when the <tag name> attribute is not present.

Default: No default

<tag name>.prompt

The value of tag prompt as defined in the tagset

Default: No default

Optional when writing tags to DGNV8

<tag name>.color

<tag name>.level

<tag name>.style

<tag name>.weight

The value of these tag properties are attributes which are standard for all elements. More information can be found under the related attributes: igds_color, igds_level, igds_style, and igds_weight. None of these are used for writing tags to DGNV8.

<tag name>.font

<tag name>.height

<tag name>.width

<tag name>.insertion_x

<tag name>.insertion_y

<tag name>.insertion_z

<tag name>.justification

<tag name>.original_justification

<tag name>.rotation

The value of these tag properties are attributes which are common to text elements. More information can be found under the related attributes: igds_font, igds_text_size, igds_text_width_multiplier, igds_insertion_x, igds_insertion_y, igds_insertion_z, igds_justification, igds_original_justification, igds_rotation.

Most of these are used for both reading and writing tags with DGNV8, with the exception of the original justification and the insertion attributes, which are only used when reading.

<tag name>.default_value

The value of tag default as defined in the tagset.

Default: No default

Optional when writing tags to DGNV8

<tag name>.display

The display value of tag as defined in the tagset. Note that the writer will always set it to NO if tag offsets are not found on the feature.

Default: no

Range: yes/no

Optional when writing tags to DGNV8

<tag name>.x_offset

<tag name>.y_offset

<tag name>.z_offset

The offset from the associated element to the origin, at the lower left corner of the tag.

If these values are not provided, the writer uses some default values to offset tags from the element.

No default

Optional when writing tags to DGNV8

<tag name>.x

<tag name>.y

<tag name>.z

The tag origin, which is a convenient access to the lower left position of the tag value, as offset from the element. This is similar to the location point of a text string element.

Default: No default

None of these are used for writing tags to DGNV8.

<tag name>.urx

<tag name>.ury

<tag name>.urz

Tag upper right range of rectangle.

Default: No default

Not required when writing tags to DGNV8

<tag name>.llx

<tag name>.lly

<tag name>.llz

Tag lower left range of rectangle.

Default: No default

Not required when writing tags to DGNV8

Note that tag writing is supported by DGNV8 only. To attach tags to an element, set the writer parameter Write Tags to Yes.writer directive WRITE_TAGS to yes There are two ways tagset and tags definitions can be carried over to V8 writer:

  1. Through DEF lines: This is the default behavior. The writer looks at the DEF lines to extract the information of tagsets and tag names. The feature type is assigned as the tagset whereas the user attributes become its tags. For instance, if the DEF line looks like this:

DGNV8_DEF Roads
         Name char(50)
         Type integer

then a tagset gets written with the name “Road” consisting two tags namely “Name” of data type string and “Type” of data type integer. The possible data types are char(n), integer and double. Note that this approach is introduced to automate the tag writing process and to avoid the amount of work involved using the “list attribute” approach as explained later. This approach has the following limitations:

  1. can write one tagset per feature only
  2. can define tag names and their corresponding data types only. The tag default, prompt and display properties cannot be set. The display property is automatically set to no and in order to turn it on the user need to set <tag_name>.display attribute on the feature with the value of yes.

To write multiple tagsets you can use the “list attribute” approach. Note that in case the writer sees list attributes under the name igds_tag_names{} it ignores the tagset definitions provided on the DEF lines.

  1. Through list attributes: Another way of writing tags is by providing all tag names as list attributes to igds_tag_names{} on the feature.

The DGNV8 writer looks for the following attributes only when writing tags and uses them to calculate all other values. Therefore, any tag related attribute provided other than the following will be ignored.

igds_tag_names{}
<tag name>.tagset_name
<tag name>.tagtype
<tag name>.prompt
<tag name>.display
<tag name>.default_value
<tag name>.x_offset
<tag name>.y_offset
<tag name>.z_offset

In case tag offsets are not provided then the writer uses some default values for the offsets and turns off tag’s display property.

Some tips on tag writing to avoid surprises:

  • When translating from DGN to DGN, it is advised to ensure that the reader parameter Output Tags as Textoption “TAG_AS_TEXT” is deselected to avoid getting extra text element on top of the tags being written. Note that this option deselected by default.
  • When translating from DGN to DGN, if the source has tags attached to a cell then note that exploding cell will result into attaching tags to each cell member. Thus, each cell member will have same tags written in the output file.