Customizing Units in the Units.def File
The units defined in a units definition file are available during a session. They can be selected in the same way as standard units. If a unit from the unit definition file conflicts with one of the standard units, the unit from the definition file is used. The active unit file is defined by the configuration variable MS_CUSTOMUNITDEF. The default file is units.def located in ..\Default\Data\ folder in MicroStation's program directory. This file includes the syntax and examples of custom unit definitions.
- Only the units defined in the units.def file are typically accessible in the user interface. To include all the known units in the user interface, define the configuration variable MS_UNITS_SHOWALL.
- The units.def file is consulted when converting data from file formats with incomplete unit information. For example, V7 dgn files provide only a two character unit label. This two character label is compared to the labels supplied in the units.def file to determine the correct mathematical definition.
Format of the Units.def File
Label,Label,...,Label; Name(singular); Name(plural); Numerator; Denominator; Base; System
- Label - Used to specify the default label for coordinate readout and dimensioning. A list of labels can be provided but only the first is used by V8 format files. The other labels are used when loading a V7 format file, in which case the label for the V7 file's master unit will be matched against all the labels that are provided.
- Name(singular) and Name(plural) - Used for display of the unit in the user interface. Use the special value "_[SYSTEM]_" to indicate that the program should use the standard built-in name.
- Numerator and Denominator - Together, these are used to define the size of the unit being described. The ratio of numerator divided by denominator represents the number X of the new unit that make up a single Meter. For example: 100.0 / 1.0 = 100.0 centimeters = 1 meter. To ensure the greatest possible accuracy, it is highly recommended that both numerator and denominator be specified as whole integer values.
- Base - Only units of the same base can be compared. All linear distance units should use a base of Meter. For non-linear units such as degrees, latitude, or longitude, specify base Unitless. Valid values for Base are:
- System - Used to catagorize units for display in some dialogs. Valid values for System are:
To customize this data make a copy of the Units.def file, place it within your Configuration, and define the configuration variable MS_CUSTOMUNITDEF with that location.