GetUnitSize()

Summary

Computes the ratio between two measurement units.

Syntax

GetUnitSize(string a_unit, string b_unit)

Argument Contents
a_unit The first measurement unit
b_unit The second measurement unit

Returns

A real number that is equal to the number of b_units in an a_unit.

Notes

  • GetUnitSize() works with both map and paper units, in any combination.

  • Both a_unit and b_unit must use the plural form (e.g., Miles, Inches, etc.).

Examples

inches_in_a_mile = GetUnitSize("Miles", "Inches")
curr_units = GetMapUnits("Plural") // What units are in use?
Five_miles = 5.0 * GetUnitSize("Miles", curr_units) // convert miles to current units
n = SelectByCircle(, "Several", Circle(ctr, Five_miles)) // select features within 5 miles

Error Codes

Error Type Meaning
Error The measurement units are not valid

See Also

Function Summary
GetMapUnits() Gets the current map measurement units
SetMapUnits() Sets the current map measurement unit
GetPaperUnits() Gets the current paper measurement unit
SetPaperUnits() Sets the current paper measurement unit