Files
-
- 60 KB
- Download
Introduction
Dimensions are a type of MicroStation element (geometry). They are a form of annotation that depict measurements on a CAD drawing. Dimensions can either be linear or angular measurements:
FME can read dimensions, which can be created within an FME workspace by defining a series of FME format attributes. In this article, we will read in DGN dimensions.
Reading Dimensions
Dimension components are read into FME as a set of features. The Drop Dimensions parameter can be found in the Advanced section of the reader parameters. This parameter controls whether the components of a dimension are split apart into separate features (dropped) or retained as a group (aggregate) feature.
Find attached an example MicroStation dataset that includes dimensions. Read the dataset into the FME Data Inspector and notice the different format attributes used to define dimensions.
Round-Tripping Dimensions
To read dimensions with FME and then write them back to a new DGN dataset, the dimension components must remain as an aggregate during the translation. If the option to drop the dimensions in FME is applied, the resulting DGN file will contain a series of separate line elements (right).
Dimensions Not Dropped Dimensions Dropped
Find attached an example FME workspace (template) that translates from DGN back to DGN, keeping the dimensions.
Writing Dimensions to DGN
Linear Dimensions:
Because of the complexity of dimensions, no single parameter exists on a DGN writer that causes dimensions to be created. Instead, the user must define dimensions using a series of format attributes. Here is a basic workspace that can be used to create dimensions for a line:
Like with AutoCAD, a dimension is an aggregate of features that are identified by having format attribute igds_element_type with a value of 33. In addition to that, there are some format attributes that the user needs to fill in so that FME can fill in the rest. In the above workspace, FME will automatically write out the correct length for the line. Below is a list of minimum format attributes needed to draw dimensions, these are all added and filled in the AttributeCreator transformer in the workflow:
| Attribute Name | Description |
| igds_element_type | Set this to 33 indicates that it is a dimension element. |
| igds_dim_type | Any value from 1 to 4 will work for a linear dimension. Recommend to set it to 1. |
| igds_class | Set to 3. This places the element in the correct class 3 means a dimension. Leaving it blank will assign it by default to Primary instead of Dimension. |
| igds_dim_refx{0}.pt.x | X coordinate of the first vertex of the line. Can be any real number. |
| igds_dim_refx{0}.pt.y | Y coordinate of the first vertex of the line. Can be any real number. |
| igds_dim_refx{0}.pt.z | Z coordinate of the first vertex of the line. Can be any real number. |
| igds_dim_refx{0}.base_offset | Offset distance from base, if set to 0 the line will be right on top of the base line that the dimension is measuring. Recommend setting to 0.25 |
| igds_dim_refx{1}.pt.x | X coordinate of the second vertex of the line. |
| igds_dim_refx{1}.pt.y | Y coordinate of the second vertex of the line.Can be any real number. |
| igds_dim_refx{1}.pt.z | Z coordinate of the second vertex of the line. Can be any real number. |
| igds_dim_refx{1}.base_offset | Offset distance from base, if set to 0 the line will be right on top of the base line that the dimension is measuring. Recommend setting to 0.25 |
| igds_base_line_cos_value | Cos value for the angle of the base line(FME calculates using radians by default), measured counterclockwise from the X axis. |
| igds_base_line_sin_value | Sin value for the angle of the base line(FME calculates using radians by default), measured counterclockwise from the X axis. |
| igds_witness_line_cos_value |
Cos value for the angle of the witness line(in radians), measured counterclockwise from the X axis. Easiest way to calculate this is to add 90 degrees to the angle of the base line and calculate the cos value. This will generate perpendicular witness lines. |
| igds_witness_line_sin_value |
Sin value for the angle of the witness line(in radians), measured counterclockwise from the X axis. Easiest way to calculate this is to add 90 degrees to the angle of the base line and calculate the sin value. This will generate perpendicular witness lines. |
The result of writing just these attributes seen in Bentley View:
The dimensions drawn when using just these format attributes are not particularly visually appealing, as FME fills in certain attribute values by default.
Below is a list of more format attributes that you may set make the output more visually appealing along with some possible settings:
| Attribute Name | Description |
| igds_dim_refx{0}.rxflags.justification | Justification for the dimension text element. It is best to match it to the element in {1}, if they do not match the text will obey the value set in the next item on the list. |
| igds_dim_refx{1}.rxflags.justification |
Justification for the dimension text element. 1 = Left 2 = Center Left 3 = Center Right 4 = Right |
| igds_arrow_height | Height of arrow drawn for dimension. Recommend setting it to 0.125 |
| igds_arrow_width | Width of arrow drawn for dimension. Recommend setting it to 0.125 |
| igds_dimstyle_left _witness | Turn the left witness line on and off. Set to 1 to turn it on, 0 to turn it off. |
| igds_dimstyle_right _witness | Turn the right witness line on and off. Set to 1 to turn it on, 0 to turn it off. |
| igds_witness_line_offset | How far offset the witness line is from the base line. Try setting it to 0.25 |
| igds_witness_line_extension | How far past the end of the arrow the witness line goes. Try setting it to 0.25 |
| igds_text_font | Set the font. Set to 1025 for Arial font. |
| igds_dim_text_width | Set text width. Recommend setting to 0.25 |
| igds_dim_text_height | Set text height. Recommend setting to 0.25 |
| igds_dimstyle_left_term | Turn on the terminator(marker at the end of the line) for the left side of the line. Set to 1 to turn it on and 0 to turn it off. |
| igds_dimstyle_right_term | Turn on the terminator(marker at the end of the line) for the left side of the line. Set to 1 to turn it on and 0 to turn it off. |
| igds_terminator |
Terminator style: 1 = Open arrow 2 = Closed arrow 3 = Solid arrow |
| igds_base_to_text_dist | Distance from base line to text. Recommend setting to 0.1 |
| igds_text_min_leader | Text minimum leader size. Recommend setting to 0.1 |
| igds_leader_to_text_dist | Distance from leader line to text. Recommend setting to 0 |
| igds_dim_stack_offset | Offset for stacked dimensions. Recommend setting to 0.1 |
The result(center-left justified text, Arial font, solid arrows, using recommended settings to create lines from the table above), opened in Bentley View :
Further information on the various format attributes can be found in these two FME documentation pages: Dimensions and feature representation.
Unfortunately, the only way to be completely sure that the dimensions are drawn out as intended is to open it in Microstation or Bentley View, FME Data Inspector does not display the features exactly the same as the other two programs.
Custom Transformer: DGNLinearDimensionDrawer
An alternative to writing in dimensions manually in the DGNLinearDimensionDrawer custom transformer available on the FME Hub. The user can feed in lines and polygons made of straight lines and this transformer will extract the lines from the features and draw dimensions. It features the ability to style the outputs as well based on user parameters.
Note that this can only handle straight lines or features made up of straight lines(rectangles, polygons). The screenshot above feeds the transformer a line from a microstation file and two lines made in FME via a creator. The dimensions and the lines are then written into a new MicroStation file. The output looks like this:
This custom transformer, though flawed, is a convenient way to draw dimensions on many linear features at once.
Arc Dimensions
Microstation can also draw dimensions on arc features, describing the radius and diameter of the line. These are similar to line dimensions, being an aggregate of features with an igds_element_type value of 33. These dimensions can be round-tripped, but FME does not currently support drawing arc dimensions.
Writing Dimensions to Other Formats
There is no specific definition for dimension features in the FME geometry model; therefore - like creating dimensions in DGN - writing DGN dimensions to another format requires the mapping of DGN format attributes to the format attributes of the other format.