DWG References To DGN Files TechNote


Document Information

Document Type: TechNote 

Legacy Document Number:  8335


In general, reference attachments should depend only on the data within the master file and the reference file, and should not depend on outside settings or auxiliary files. However, in certain circumstances, MicroStation Versions 8.0 and 8.1 produced attachments of DWG files referenced to DGN files that were affected by the resolution of the DGN file used as the seed file for opening DWG files. In this case, changing the resolution of that seed file (or substituting a file with different resolution for the seed file) could cause the references to move to different locations - sometimes to the extent that the graphics disappear completely as the geometry is moved to a location that is outside of the reference clip boundary.


The problem described above occurs only when DWG files are attached as references to DGN master files using MicroStation V8.0 or V8.1. Coincident attachments are not subject to this problem unless the reference is subsequently clipped. Such reference attachments display in the correct location as long as the same translation seed file that was in effect at attachment time is used, but using a translation seed file of a different resolution will cause the references to be dislocated.

The seed file referred to above is the one that is listed as "DGN Seed File" circled in the "DWG Open Options" dialog box below.

The resolution that is important is the value specified in the "Advanced Unit Settings" dialog when the seed file is opened in MicroStation. Note that only the effective resolution value is important (i.e. 12000 units per foot is equivalent to 1000 per inch).



MicroStation Version 8.5
In MicroStation 8.5, the reference file attachment and manipulation tools have been corrected such that the location of any reference created or modified with the 8.5 tools is fixed and will not change if the seed file resolution is altered. These attachments are independent of the seed file resolution and will display in the correct location for any seed file (even with older versions of MicroStation).

Correcting Existing Attachments (fixreforigins.ma)
To correct references that were attached using MicroStation V8.0 and V8.1, we have written an MDL application called "fixreforigins". Click here to download.

Important Note: In order to run this utility it is first necessary to locate and configure MicroStation to use the same seed file (or more precisely the same seed file resolution) that was used when the reference files were originally attached. This means that in order for the utility to fix the reference attachments they must first be displaying in the correct location.

Warning: Running fixreforigins.ma on attachments which are not displayed in the correct location will permanently fix the attachments at the wrong location and make it impossible to recover the correct attachment position.

To run the application, put fixreforigins.ma in your bentley\program\microstation\mdlapps\ directory, run MicroStation, open the DGN file with DWG attachments and verify that the reference attachments are in their correct locations. Then open the keyin dialog, and type in "mdl load fixreforigins".

The utility scans through your references and fixes the origins of all the DWG references. If you want feedback while it is running, you can use the "interactive" mode. In that case it will prompt you before fixing each reference with a dialog box with a query of the form:

"Fix origin for Slot 1 attachment file '032a-rax.dwg'?" with Yes, No, and Cancel buttons. If you say Yes, it will make the change.

Additional Notes:

There are two optional command line arguments:

	mdl load fixreforigins [-y] [-n] [-f] |-?] [logfilename]	    'n' (or no argument) means do not query for each reference	    'y'  means query for each reference	    '?' or 'h' shows usages message
  1. If you start it with "mdl load fixreforigins" it will change all attachments without asking you.
  2. It can only fix the origin for references that it can find. If it can't find the reference, it doesn't know how to fix it.
  3. It fixes only DWG references attached to DGN V8 files. Other attachment types do not need to be fixed.
  4. It reports the actions it takes to the message center. The number of messages that the message center saves is limited, so you can also have it create a log file by giving the second command line argument as a full file specification.
  5. You can use it in conjunction with batch process to process many files. In your command file, just put something like: mdl load fixreforigins d:\tmp\relative.log (or use the 'y' argument if you want it to ask you before it fixes the origins). Before doing a batch process, you should back up your design files in case you don't like the results.

See also

Other language sources

 Original Author:Bentley Technical Support Group