Skip to main content
I am trying to read a number of Microstation DGN (v8) files with tags into a number of ESRI shapefile attributes.

 

I found that selecting a Group Elements by "Schema - Level Names" option from within the DGN V8 Reader Parameters works for a single DGN. It exposes tag values in User Attributes on the DGN Reader.

 

 

 

 

However, I found that I cannot develop a single workbench to handle multiple DGNs with different set of tags (i.e. attributes), as the User Attributes are different for every DGN with different tags. For example, if I used an AttributeCreator and assign tag values to attributes, it would work for one DGN, but the parameters would be invalid for a DGN with different set of tags, i.e. other user attributes.

 

How is it possible to read DGN v8 tags dynamically, i.e. so that they are read dynamically for every DGN and I can work with the tag values as attributes?

 

I am a new user and would appreciate a step by step guide if possible.
Hi,

 

 

Sorry, I'm not clear what your requirement is.

 

Maybe:

 

 

- Every dataset (DGN file) has these attributes.

 

RINM08-*****-1

 

RINM08-*****-1.prompt

 

RINM08-*****-1.tagset_name

 

RINM08-*****-1.tagtype

 

 

- The part of ***** is vary depending on dataset.

 

 

- And you need to change the attribute names to a common names.

 

e.g. RINM08-*****-1.prompt => prompt

 

 

Is my understanding correct?

 

 

Takashi
Hi Takashi, 

 

 

Many thanks for attending this question.

 

 

Not every DGN will have a full set of tags, as the content of each DGN will differ. For example, DGN 1 will have a water level which has RINM08-00907-1, RINM08-00908-1 and RINM08-00911-1 tags, but DGN 2 will have a building level with RINM08-00305-1 and RINM08-00306-1  tags, a vegetation level with RINM08-00907 tag  and no water level at all.

 

 

In the Attribute Creator I added all possible attributes that may occur, but they will not all be present for every DGN, i.e. DGNs will have different subset of these tags/attributes. When I run my workbench on say DGN_1 I get the "Invalid Transformer Parameters" message at the start, because some attributes I added in the Attribute Creator are not present. It runs but I get this message every time which I need to click in order to proceed. I will have a large number of DGNs to run and running them one-by-one (due to this message at the start) is not an option. Is it possible to read DGN tag values in a more efficient and generic way?

 

 

 

Thanks,

 

 

Magda

 

 

 
If you are trying to expose hidden attribute names (i.e. may occur, but not shown in the reader feature type on the canvas), you should use the AttributeExposer transformer.

 

 

In addition, every attribute name for ESRI Shape format should be less than or equal to 10 bytes (characters). It's a restriction based on the Shape format specification.
HI Takashi, 

 

 

I added the AttributeExposer and defined all attributes, but when running with DGN_1 as input, that have some but not all tags as defined in the Attribute Exposer, feature is getting dropped completely by the FileGDB writer. Please see a warning message.

 

Re. attribute names, I actually changed the ESRI shapefile for ESRI File Geodb which allows for longer attribute names.

 

 

 

 

The resulting feature class is empty after adding the AttributeExposer to it, i.e. no geometry, as it has been dropped.If I remove the AttributeExposer, then it runs and writes a feature to a FileGDB, but with the warning message at start.

 

 

I have uploaded my FME template. Your help much appreciated!

 

 

https://www.dropbox.com/s/qhna0vg4wso885k/dgnv82filegdb.fmwt?dl=0

 

 

 

Thank you

 

 

Magda
In my observation, originally "RINM08-00305-1" and "RINM08-00306-1" were missing value, but empty string has been assigned to them after renaming with the AttributeRenamer.

 

Since the destination field type is "double", the writer rejected the feature (a string cannot be written into numeric field).

 

 

I'm not sure why the AttributeRenamer assigns empty string to missing attributes, but you can use the NullAttributeMapper transformer to replace empty string with <null>, so that the issue can be avoided.

 

Try inserting a NullAttributeMapper before writing,  with these parameter settings.

 

Map: All Attributes

 

If Attribute Value Is: Empty

 

Map To: Null
Takashi, 

 

 

That worked as I expected. Thank you very much for a brilliant support!

 

 

Magda
Another solution.

 

If you set <No Action> or <Null> to the Default Value column in the AttributeRenamer parameters dialog, the NullAttributeMapper can be removed.

 


Reply