Units of Measurement
 
 
 

3ds Max allows users to work with units that they are most comfortable with. Users may specify that they wish to work in US Standard units (Inches, Feet, Miles) or Metric units (Millimeters, Centimeters, Meters or Kilometers). Or they may specify a custom setting (for example perhaps they want to work in fathoms). Users may also work with generic units (these are the same as the default 3ds Max master units).

Internally 3ds Max keeps track of all measurements in its own internal unit called the master unit. The program converts measurements from user-defined units into the master defined unit for storage and computation. The master unit is defined as 1.0 inch.

To retrieve the current unit display information one can use GetUnitDisplayInfo().This returns the information describing 3ds Max's current system of measurement. This includes the type of units used, how they are displayed and custom unit name and scale. A developer may also use SetUnitDisplayInfo(). This allows the developer to control the unit settings.

Two functions are available for converting units in and out of ASCII form. These are FormatUniverseValue()and DecodeUniverseValue(). FormatUniverseValue() converts the specified value to its ASCII representation using the current unit display settings. DecodeUniverseValue() parses the specified measurement string and converts it to a floating point value.

Developers can use the method GetMasterScale() to retrieve the master scale in terms of the specified unit type. For example passing UNITS_INCHES returns the number of inches per unit (unless altered by the user this would be 1.0).

Consult the C++ Reference's "Related Pages > Lists and Functions > Units of Measurement Reference" to review the methods discussed above.