EAGLE Help

Unit Conversions


Function
Converts internal units.

Syntax
real u2inch(int n);
real u2mic(int n);
real u2mil(int n);
real u2mm(int n);

Returns
u2inch returns the value of n in inch.
u2mic returns the value of n in microns (1/1000mm).
u2mil returns the value of n in mil (1/1000inch).
u2mm returns the value of n in millimeters.

See also UL_GRID

EAGLE stores all coordinate and size values as int values with a resolution of 1/10000mm (0.1µ). The above unit conversion functions can be used to convert these internal units to the desired measurement units.

Example

board(B) {
  B.elements(E) {
    printf("%s at (%f, %f)\n", E.name,
           u2mm(E.x), u2mm(E.y));
    }
  }

Index Copyright © 2005 CadSoft Computer GmbH