AutoLISP
Developer's Guide > Using the AutoLISP
Language > Using AutoLISP to
Communicate with AutoCAD > Conversions > Unit
Conversion >

The Unit Definition File

*acad.unt*, you
can define factors to convert data in one set of units to another
set of units. The definitions in *acad.unt* are
in ASCII format and are used by the unit-conversion function
*cvunit*.

*acad.unt*. A definition consists of two
lines in the fileâ€”the unit name and the unit definition. The first
line must have an asterisk (*) in the first column, followed by the
name of the unit. A unit name can have several abbreviations or
alternate spellings, separated by commas. If a unit name has
singular and plural forms, you can specify these using the
following format:

*[ [common] [ ( [singular.] plural) ] ]...

You can specify multiple expressions (singular and plural). They don't have to be located at the end of the word, and a plural form isn't required. The following are examples of valid unit name definitions:

*inch(es)

*milleni(um.a)

*f(oot.eet)or(foot.feet)

**unit name* line defines the
unit as either fundamental or derived.

**unit name* line begins with something other
than an equal sign (=), it defines fundamental units. Fundamental
units consist of five integers and two real numbers in the
following form:

c, e, h, k, m, r1, r2

The five integers correspond to the exponents of these five constants:

*c* Velocity of light in a vacuum

*e* Electron charge

*h* Planck's constant

*k* Boltzman's constant

*m* Electron rest mass

As a group, these exponents define the dimensionality of the unit: length, mass, time, volume, and so on.

*meter* and *metre*); the case of the unit is ignored. An example of
a fundamental unit definition is as follows:

*meter(s),metre(s),m

-1,0,1,0,-1,4.1214856408e11,0

In this example, the constants that make one meter are as follows:

**unit name* line begins with an equal sign
(=), it defines derived units. Valid operators in these definitions
are * (multiplication), / (division), + (addition),
- (subtraction), and ^ (exponentiation). You can specify a predefined unit
by naming it, and you can use abbreviations (if provided). The
items in a formula are multiplied together unless some other
arithmetic operator is specified. For example, the units database
defines the dimensionless multiple and submultiple names, so you
can specify a unit such as micro-inches by entering *micro inch*. The
following are examples of derived unit definitions.

; Units of area

*township(s)

=93239571.456 meter^2

The definition of a township is given as 93,239,571.456 square meters.

; Electromagnetic units

*volt(s),v

=watt/ampere

*acad.unt*, both watts and amperes are defined
in terms of fundamental units.

To include comments, begin the line with a semicolon. The comment continues to the end of the line.

; This entire line is a comment.

*acad.unt* file itself for more information and
examples.