FOM Reference > Application > Datatypes > fUnit interface
  
fUnit interface
This object describes a unit for use when converting lengths. Objects of this class also permit changing APP's built-in units and adding your own. APP's default units of measurement are defined in ssys.3ad . User-defined units are not stored with a document. If you need to transfer a document that uses user-defined units to another system, you should ensure compatibility by including the appropriate code to set up fUnit objects in the document's autoexec script.
base attribute
The natural 'divisor' for this measurement. This will be used on rulers for tick marks and will also be used to calculate the second part of two-part units.
base
Access
read-write
Returns
int
conversion attribute
A floating point number accurate to many decimal places which specifies the size in millimetres of the unit.
conversion
Access
read-write
Returns
float
index attribute
A number from 1..13 specifying which of the 13 different unit types this object represents. Units 1..7 are APP's default system units..
index
Access
read-only
Returns
int
link attribute
Links to a 2nd part of a two-part unit (e.g. "pc" would link to "pt" and "cc" would link to "dd").
link
Access
read-write
Returns
fUnit
minimum attribute
Do not use this unit in non-strict mode unless the measurement is less than the given minimum size (in millimetres).
minimum
Access
read-write
Returns
int
name attribute
Long name of the measurement up to 12 characters. Used in the document preferences and ruler dialogue boxes.
name
Access
read-write
Returns
String
shortLocalizedName attribute
An alternative abbreviation for the same measurement. Intended for use on non-English systems where the abbreviations need to be translated.
shortLocalizedName
Access
read-write
Returns
String
shortName attribute
A two-character string representing the units abbreviation (e.g. "in" for inches). This abbreviation is used when entering unit measurements in 3B2.
shortName
Access
read-write
Returns
String
fUnit method
Creates a new unit object.
fUnitunit
Parameters
Stringunit
The abbreviated name of the desired unit, or a number from 1..13 specifying one of the 13 different unit types. Units 1..7 are APP's default system units.
Returns
fUnit. The newly created fUnit object.
toString method
Returns the name of this unit.
toString
Parameters
None
Returns
String. A string representation of this fUnit object.