Upgrading Your HMR Raster Attachments To MicroStation V8 [CS]


This Client Server article is republished in its entirety from 2004 for reference purposes.

By Bentley Technical Support Group
08 March 2004

The problem:

My HMR images are no longer displaying ever since I opened my MicroStation/J design file in MicroStation V8.

When I viewed my DGN file in MicroStation/J, the HMR images that had been attached with Image Manager displayed in the proper location. When I opened my DGN file in MicroStation V8, my images are listed in the Raster Manager dialog box, but they are not lining up with the existing line work.

Why this is happening

Author's note: This work-around may not apply if a custom imgmngr.ini file was used or if the MicroStation V8 definition of working units has been modified.

The image disappears because MicroStation V8 uses the resolution in the MicroStation/J working units to define custom sub units. The HMR image location changes as a result of the working unit change. In the example below, the problem is not the design file working units, but rather in the way Image Manager hard codes the definitions for the working units when writing the image header.


The following conventions are used in this document to identify key components in the required calculations:

MicroStation/J and prior working unit abbreviations

MU Name

MicroStation master unit name (label)

SU Name

MicroStation sub unit name (label)


MicroStation sub unit to master unit of ratio


MicroStation positional unit resolution value


HMR INI file abbreviations


HMR INI file default master unit value


HMR INI file default sub unit value


Adjustment ratio abbreviations


Ratio of MicroStation custom "SU/MU" to a given HMR master unit


HMR image INI file master unit scale factor


HMR INI file adjusted sub unit  

A practical example

As a practical example, we will take a given MicroStation/J and prior design file with working units defined as:

            Unit Names

Master Units


Sub Units









When MicroStation V8 and higher imaging products encounter a MicroStation/J or prior design file with custom working units defined, the product will attempt to calculate an internal "SU/MU" ratio based on the following MicroStation/J and prior design file working unit fields:

The MicroStation V8 imaging products, by default, perform a lookup based on the unit labels within the appropriate configuration settings INI file (e.g.... \\imgmngr\imgmngr.ini). In the case of a MicroStation/J or prior design file with custom working units defined, the fields MU Name, "SU/MU", and SU Name will be referenced to determine the appropriate labels and "SU/MU" ratio to be applied.

Author's note: If the Unit Names are not populated, by default the blank value is defined the value of 1.

For this example:

Imgmngr.ini and working units



Note in particular the magnitude of difference between the HMRMU and HMRSU against which the HMR products process images. Compare them to the SU Name and MU Name of the MicroStation/J and prior design file custom working unit names.
Also worth noting is that the decimal values used in the HMR INI file currently support a maximum of 17 significant digits of precision. You may optionally use scientific notation if high degrees of decimal accuracy need to be maintained.

MicroStation V8 and higher HMR imaging software apply the following calculation:


For this example:

DGN2HMR = 10 * 0.0003047999999999

DGN2HMR = 0.003047999999999

To calculate the difference between the intended MicroStation/J and prior custom working units files and the actual HMR INI file definitions, we can use the following formula:


For this example:

FX = 0.003047999999999 / 0.30480000000000002

FX = 0.009999999999997

Calculate an adjusted sub unit


HMR calculated "SU/MU" ratio = Default HMRMU definition value / MicroStation/J "SU/MU"

======================== = ===================== / ================

Sub Unit Def = (MU ini def) / (Res SU per MU)

0.030480000000000002 = 0.30480000000000002/10 / 10

If the Sub Unit Def is not in the HMR INI file the new definition will need to be added. In this case, because the sub unit def of 0.030480000000000002 does exist, we can use the predefined definition of "TN" or we can add a new entry with a unique two-character abbreviation.

Editing the imgmngr.ini file

  1. Close all MicroStation sessions and open your imgmngr.ini file in a text editor.
  2. Under the [Definitions]Measurement Units section add the following: FX,Factor,
  3. For this example, the factor is FX = 0.009999999999997, so "FX,0.009999999999997," would be added in this case.
  4. Save changes to the imgmngr.ini file.

Making changes in MicroStation

  1. Start MicroStation V7 and enter the design file with your images attached using Image Manager.
  2. Choose Settings>Design file > Working Units and change the sub unit (SU Name) abbreviation from the original to a two-character abbreviation from Step 4 above (for this example th to tn).
  3. In the Key-in window (utilities> key-in) type the following: IMG WORLDFILEUNIT SET=FX (to enter the key-in select return)

Saving Images

To successfully apply the fix factor, the HMR image will need to be saved as a TIFF with a TFW (world file). The georeferencing for the TIFF image is saved in the TFW file, which is an ASCII file that contains the pixel size, rotation and origin of the image. The TIFF with TFW is the best format to use to fix this issue, since the world file default unit can be modified to fix the factor by which the image location is saved.

In the Image Manager dialog box select File> Batch Conversion

Select the HMR files you need to convert (please note, only convert HMR images that were created with the same working units)

  1. In the Batch Conversion dialog use the following for your image output: Type: TIFF
  2. Pixel Type: (enter the pixel type of the images you are converting)
  3. Data Compression: (the compression will not affect position)
  4. Directory: Specify an output directory
  5. SELECT the Options button and set the Location Format: World File
  6. After the images are finished converting.
  7. Detach the images, File> Close All
  8. In the Key-in window, set the following: IMG WORLDFILEUNIT SET=M
  9. In Image Manager, attach the images and they will open in the correct location when used in both MicroStation/J and MicroStation V8.

Please note, this work-around is not applicable in builds of MicroStation /J or previous versions that have Raster Manager installed.

See Also

Client Server Archive

Raster Product TechNotes And FAQs

MicroStation Desktop TechNotes and FAQs

Comments or Corrections?

Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!