Description

Microstation Design (aka Designfile, DGN or IGDS) is the format used by Bentley's Microstation and some Intergraph products such as MGE or FRAMME. It is one of the most commonly used formats in the CAD/utilities market.

More information on the Design format can be found in the FME Readers and Writers manual

Point Geometry

IGDS does not have a native point feature.

(True it has cells, which relate to a single point, but a cell is built up from a number of other elements and is more difficult for the novice FME user to control. Plus a cell requires a definition to pre-exist in a cell library - another drawback for users looking to simplify the process).

The easiest way to create a point feature without the use of cells is to use zero-length lines.

A zero-length line is a line feature where every point has the same co-ordinates; the usual is to have only two points (since subsequent points would be unnecessary duplicates).

FME applications read zero-length lines from MicroStation as point features (FME_TYPE=FME_POINT).

Unless told otherwise FME will write points to a Design File as a zero-length line feature (IGDS_ELEMENT_TYPE=4)

Reference Files

FME is able to read data which is stored in reference files - ie files 'attached' to the original dataset.

Q) If I have the 'Read Reference Files' setting unchecked why does FME read them anyway?

A) It's correct that, with this setting off, FME will not read the reference files during a translation. However, it will always do so when creating a new workspace.

FME always attempts to read your reference files during a workspace creation so that all of the feature types (level or geometry) within them can be correctly added to the workspace.

If FME did not do this subsequently changing the setting to YES might have no effect because the reference file feature types could be missing.


Q) Why do I get the error "DESIGN READER: Failed to open reference file... this reference file is skipped"?

A) What this means is that FME attempted to read a DGN file which is referenced by (ie attached to) the master file, but could not find that file.

Even when you have the 'Read Reference Files' setting unchecked, FME attempts to read your reference files during a workspace creation so that all of the feature types (level or geometry) are correctly added.

So, if you see this warning during a workspace creation, and wish to read the missing reference files at a later stage, make sure you add the correct feature types (or the unexpected input remover will gain another victim)!!!

Cells

Cells are such a complex subject that they get a whole fmepedia page to themselves(Article#: 000001508)!

Complex Chains

Q) How can I write Complex Chains to Microstation DGN using FME?

A) Create an Aggregate of all the features needing to be chained. Set the format attribute igds_type to be igds_complex_chain


Q) When writing MicroStation DGN, my Complex Chains only have a single line element. What is happening to the individual parts?

A) Unfortunately when FME creates complex chains all of the individual parts of the aggregate are merged together. I think it's a limitation of the underlying toolkit (though I could be wrong).

Complex Shapes

Q) When writing MicroStation DGN, when will I get Complex Shapes and can I force a feature to become a Complex Shape?

A) In a DGN to DGN conversion, if a feature is read as a complex shape it will generally be written as a complex shape.

  • V8: When writing to V8 you may force a regular shape to become a complex shape by setting the igds_element_type (to 14?).
    • Any feature with more than 5000 vertices will become a complex shape regardless of this (this is a MicroStation imposed requirement).
  • V7: When writing to V7 complex shapes are only formed when a feature has greater than 100 vertices; setting igds_element_type has no effect

Writing MSLinks

To write MSLinks You need three things (as a minimum):
  •     an mslink for each feature
  •     an entity number for each table
  •     a linkage type attribute

See the attached workspace.

User-added image

Above: The workspace reads a single shape file and branches it in two directions.

One stream is aggregated together based on the source filename and an entity number created - with this setup there'd be one entity (table) per source dataset. An alternate would be to use an AttributeCreator to give a fixed entityNum to all features.

The other stream creates an mslink number. An alternative is to use an existing ID number from the source data.

The entityNum is attached to the features using a FeatureMerger.

Aggregated entityNum features are written to mscatalog to give a table record.

Features are written to the data table (worlddata) and to the DGN file.

On the DGN file output I have "exposed" mslink_0, link_type_0 and entity_num_0 - you expose these by opening the DGN level properties, clicking the 'Format Attributes' tab and placing a check-mark against each of these.

Then I use an AttributeCopier to copy the mslink and entitynum attributes to the correct DGN attribute. I use a constant to set the type to ODBC (constants aren't the best way to go - but it illustrates the point here).

User-added image

Above: The output is a user data table...

User-added image

Above: Another output is an entry in the mscatalog table...

User-added image

Above: In MicroStation I open the DGN output and connect to the database.

User-added image

Above: And finally the MicroStation database query tool reads back a record to prove it has all worked.

DGN and SVG

Want to cook SVG vector symbols out of symbology stored in cells in dgn files or in dgn cell libraries??

Here(Article#: 000001529) is the Great Banana Chef's (a.k.a SRG) very own recipe to get symbology stored in IGDS or DGN cell library to SVG vector symbols.

DGN and Top10

Translation TOP10 to GeoGraphics requires a template database where all relationships between feature geometry and attributes are predefined. They are kept in the UGJOIN_CAT table and called long-term table joins. The rest of the GeoGraphics projects should be set up as usually. Then we run the workspace gml2ggAll.fmw, which creates a dgn file and two tables within the database for each feature type, which may have more than one geometry per feature type. Tables directly connected to features contain only gml_id and gml_geometry_property, and separate tables contain all the attributes.

User-added image

In order to get these attributes while reviewing features, we have to do the following - after project is opened, we go to the menu 'Database'-> 'SQL Query Builder'. In the 'Visual SQL Query Builder' menu we call 'Tables' -> 'Read Join Table', 'Select Join Table' appears. There we pick a join (for example, 'wegdeel.gml_id - wegdeeldata.gml_id'). This will bring a query to the 'SQL Select Statement' text box of the 'Visual SQL Query Builder' dialog. We should add an asterisk (*) after Select in order to get the following statement:

SELECT *
FROM WEGDEEL,WEGDEELDATA
WHERE WEGDEEL.gml_id = WEGDEELDATA.gml_id


And press 'Execute'.

This will call a form ('Wegdeel' in our example) with all the attributes from two tables. With 'Review' button we can review attributes of all the features. Editing values and pressing 'Update' button will change the record, and this will be reflected on all features with the same gml_id - for example, centerline, road edges and road polygon because they all are pointed to the same record in wegdeeldata table.

User-added image

The workspace gg_mdb2gml.fmw is used for translation back to TOP10.

The workspaces in the attachment section were tested with the build 2576.

Note, that the attached examples will work with the Relay example file. Some of the feature types were not presented in that file, and they didn't get into the gg_mdb2gml.fmw workspace. The attached examples illustrate the technique applied to GeoGraphics, and should be used with care - some modification may be required to work with another datasets.



Q+A

Q) What is IGDS? What does it have to do with MicroStation?

A) The term IGDS stands for Interactive Graphics Design System. It was an Intergraph product that was a precursor to MicroStation.

Both IGDS and MicroStation use a file format called ISFF; Intergraph Standard File Format.

The phrases "IGDS File" and "Design File" both refer to the same format, so the terms can and are used interchangably.

Q) What is the Type 3 option for when writing MicroStation DGN data?

A) IGDS has two types of line feature; type 3 and type 4.

A type 3 line is a two point line, a type 4 line is a multiple point line, sometimes called a polyline.

To correctly follow the IGDS specification FME would normally write a two-point line as a type 3 element.

However, some users have alternate software that does not recognise a type 3 element, so this option allows them to write two-point lines as a type 4.

You could also acheive this result by manually exposing and setting igds_element_type to either 3 or 4 (virtually the only occasion on which you would need to manually set this attribute).

Q) When I translate DGN to DGN why do the output arcs have different sweep angles to the input?

A) A decision was made to work only with positive sweep angles within FME.

On reading your DGN dataset any negative sweep angles will be changed to positive, and the start angle adjusted to compensate.

Mathematically speaking your arcs will be exactly the same. At worst the orientation will be a different direction, but this generally isn’t a problem for arc features.

Q) FME refuses to open my Design File. How can I tell if the file is corrupt?

A) Before sending us a design file which refuses to open in FME, you can check whether it is a corrupt file using MicroStation

  • V8: Use the MicroStation Verify option.

Copy the file into c:\program files\bentley\program\MicroStation, open a Command Prompt window and navigate to the file.

To verify the file's contents use the command...

ustation.exe -verify <filename>

To load, verify and repair the file use the command...

ustation.exe -vrg <filename>
  • V7: Use the MicroStation EDG tool.

Copy the file into the EDG directory, open a Command Prompt window and navigate to the file, using these commands...

Move to the EDG directory     cd c:\win32app\ustation\edg or cd c:\bentley\program\edg
Start EDG            edg
Enter file name...        <filename.dgn>
Set the search parameters    set search/all
Set the verify parameters    set verify/all


To verify the file contents use the command...

Verify the file contents    verify whole/none

To auto-repair the file contents use the command...

Repair the file contents    repair whole


To save and exit EDG use the command...

Exit EDG                        exit


If the design file with the problem is one that was created by FME, then you should also check the seed file you used to create it using the same methodology; i.e. you need to check if the problem is being inherited from elsewhere before you can assume it is FME related.

Q) Why does the help for the IGDS format Group-By setting say I may get a lot of output files?

A) You may get a large number of output files because some formats (Shape, CSV, MID/MIF, TAB) aren't able to hold multiple Feature Types (such as DGN levels) in a single file. Shape particularly is a problem because each file can also only hold a single geometry type.

So if you converted DGN to Shape the standard translation would give you one Shape file per level per geometry.

For example, level1_lines.shp, level1_points.shp, level1_arcs.shp, level2_lines.shp etc.

With 63 levels and, say, 10 geometry types, you could end up with 630 output Shape files for each input DGN!

Q) Does FME support MicroStation Named Groups?

A) No, only graphic groups.

Supported:
User-added image

Not Supported:
User-added image

Q) When I write to DGN V8 some features have bad 'range' values causing problems in MicroStation. What is happening?

A) Although the coordinates in V8 DGN are stored as doubles the range values are stored as 64-bit integers. The third party tookit we use does not support these so when the coordinates (in UORs) pass a certain size the ranges will not be correct.


Because the problem is related to values in UORs, the more precision you use and the larger the coordinates, the more likely the problem is to occur. For example, data with mm precision (1000uor/m) will exhibit this problem when the coords go past approximately 3866000 (=3866000000 UOR). The problem wouldn't occur with cm precision (100uor/m = 386600000 UOR)


For this reason I would advise against writing V8 data in a UTM coordinate system using mm precision. UTM is a particular problem because the northings have such high values. If you can use cm precision only then the problem is unlikely to occur (all FME seed files have cm precision as a default).

Q) How do I maintain the Feature Order in writing a Design File?

A) Feature Order is important in MicroStation because it determines the order in which features are drawn, and therefore the order in which polygons overlay each other.

In FME the data comes out of the dgn writer in the same order as it was read (assuming a source dgn file) so drawing order in MicroStation is generally unaffected. The main problems are where the data is split through different transformers in Workbench in which case order cannot be guaranteed.


If this is likely attach a number attribute (using the Counter transformer) beforehand and then use a Sorter transformer at the end to get them back into the original order.


To sort a set of data by the original layer you would obtain the source layer name using the FeatureTypeExtractor transformer, map that to a numeric value using a ValueMapper, and then sort on that numeric value using the Sorter.

Q) When reading DGN files I got an error message relating to MSCATALOG or the Feature Table Name. What does this mean?

A) The message 'mscatalog not found' or 'Invalid Alternative Feature Table Name' suggests you are trying to open a MicroStation file as if it were a GeoGraphics or MGE project.

Check that you have the FME dataset type set to "MicroStation Design" and not "MicroStation GeoGraphics" or "Intergraph MGE".

FME automatically interprets your file type by extension but, since Design files, GeoGraphics data and MGE data all have the same *.dgn extension, it may occasionally mis-select.

Q) I'm trying to do a Dataset Fanout when writing DGN data - but the fanout option is missing. What's the problem?

A) The most likely problem is that you are mistakenly trying to write the data as if it were a GeoGraphics or MGE project.

Check that you have the FME dataset type set to "MicroStation Design" and not "MicroStation GeoGraphics" or "Intergraph MGE". You can quickly find this by looking at the dataset in the navigation pane - it will say [IGDS] for a plain DGN writer but [DGNV8] for a GeoGraphics project.

If you set it up by typing 'DGN' into the destination format field then FME will try to interpret this but, since Design files, GeoGraphics data and MGE data all have the same *.dgn extension, it may occasionally mis-select.

Q) What is a DGN seed file?

A) A seed file is an empty Design File which is used as a template to create your output Design File.

It holds basic parameters such as coordinate precision, MicroStation version, dimensions (3d or 2d) and working units (m, ft, km, etc) which are then carried forward into your output.

Q) I've been told your DGN seed files don't work - why not?

A) The seed files provided with FME are designed to meet the basic needs of a MicroStation user (for example, a 2d, version 8 file in metres).

They won't meet all requirements (for example we don't provide a seed file in kilometres) so if you have unusual settings you will need to create your own seed file in MicroStation.

If you do use your own seed files you can store them anywhere on your PC, the only obligation is that you change the seed file setting in Workbench to point to the correct file.


Tip: V7 format is less flexible than V8 in terms of the data size and precision allowed. For example, you can't write UTM data with mm precision to V7 because the data will exceed the permitted UOR range. This isn't an FME fault, but a limitation of the format.