Question

How can i read the DIMENSION parameter of a DGN to determine if a dgn file is 3d file or 2d file.

  • 5 November 2015
  • 5 replies
  • 4 views

How can i read the DIMENSION parameter of a DGN to determine if a dgn file is 3D file or 2D file. We have a lot of dgn files and would like to find a way to identify the files which are 3D. Is there a way to do this?

 

Please see the screenshot below from FME data inspector. I would like to read the property highlighted in red color and make a decision if the file is 3D or 2D.

 

 

Thank you.

 


5 replies

Userlevel 2
Badge +17
Hi,

 

 

I don't think there is a way to know that per file (dataset). For each feature, the DimensionExtractor can be used to determine if the feature is 2D or 3D. "3D" displayed in your screenshot is the dimension of the selected feature.

 

 

Takashi
Thanks Takashi. I will try the DimensionExtractor; eventhough I Will have to scan all elements I think I can flag the file using this transformer. I have been searching the net and found that there is a byte in the DGN file header which stores the dimension of the file. I will see if I can parse this TCB (Terminal Control Block) to read this information.
Userlevel 2
Badge +17
If the position of the flag byte was fixed (the Nth byte from head of the file), it's relatively easy to read the flag value with Python script.
Userlevel 4
Badge +25
You can also use the 'features to read' parameter for the Reader, so you only read the first 1 or 2 features. If they are 3D then it's safe to assume it's a 3D DGN file - and then you don't have to read the entire dataset.

 

Userlevel 4
Badge +13

A bit late to the party, but check out https://knowledge.safe.com/questions/42872/how-can-i-check-if-a-dgn-file-is-2d-or-3d.html for additional ideas.

Reply