Question

How derive global origin x,y and z from a dgn file?


Badge +13
  • Contributor
  • 58 replies

Hi everyone,

This is a very specfic question and is targeted towards the persons who work a lot with dgn files in FME Desktop. I ask this question on behalf of my colleague.

 

He is reading in a lot of dgn files in FME Desktop made by other persons from other departments and some drawings have a global origin that is not x = 0, y= 0 such as in beneath image. My colleague would like to derive these global orign x, y and z values so we can move the global origin of these dgn files to x en y =0. Does anyone thus know if the global origin x and y values are stored in some kind of parameters? When reading in the dgn files in fme desktop the global orign x, y and z are known (see image below). So it looks to me that these values are stored in some kind of variables.

 afbeelding


3 replies

Userlevel 2
Badge +17

Hi @joy​,

The LogMessageStreamer transformer can route the log messages into the workspace to allow you to extract the Global Origin parameters:

Screen Shot 2023-05-03 at 1.58.00 PMUse a Tester to isolate the global origin message, then a StringSearcher to extract the Global Origin values.

Badge +13

Hi @joy​,

The LogMessageStreamer transformer can route the log messages into the workspace to allow you to extract the Global Origin parameters:

Screen Shot 2023-05-03 at 1.58.00 PMUse a Tester to isolate the global origin message, then a StringSearcher to extract the Global Origin values.

hi @daveatsafe​ 

Thanks for this suggestion. My colleague is partly in the right direction based on your script. However my colleague's script is fairly big and

the LogMessageStreamer runs at the end when all other transformers/reader have ran. Is it possible to trigger the LogMessageStreamer midway in the script? Midway in the script my colleague has several dgn files that are going to be read in and my colleague wants to have the global origin x, y and z from the dgn files midway and can use the output from the LogMessageStreamer in the rest of the script. Another question of my colleague is how to derive from which model the global origin x, y and z has been derived. So instead of only finding different x,y and z values, you can also see to which model the xyx values belong.

 

Userlevel 2
Badge +17

hi @daveatsafe​ 

Thanks for this suggestion. My colleague is partly in the right direction based on your script. However my colleague's script is fairly big and

the LogMessageStreamer runs at the end when all other transformers/reader have ran. Is it possible to trigger the LogMessageStreamer midway in the script? Midway in the script my colleague has several dgn files that are going to be read in and my colleague wants to have the global origin x, y and z from the dgn files midway and can use the output from the LogMessageStreamer in the rest of the script. Another question of my colleague is how to derive from which model the global origin x, y and z has been derived. So instead of only finding different x,y and z values, you can also see to which model the xyx values belong.

 

Hi @joy​,

It may be necessary to add the LogMessageStreamer first in the workspace. Please try creating a new empty workspace, adding the LogMessageStreamer, then copying and pasting all the transformers from the existing workspace.

The DGN file name is also logged, so with a few alterations, we can use the previous feature attribute option in FME to merge the file name and global origin messages. I am attaching an updated workspace illustrating how to do this.

Reply