Overview of Units Object

Build 1501 on 14/Nov/2017  This topic last edited on: 18/Jun/2013, at 16:56

The Units object provides conversions between strings and measures expressed in millipoints.

The measurement string use the same syntax of the measures string in Ted and Fred dialog.

GN4 scripting commands expect measures expressed in the internal measurement unit, that is millipoints i.e. thousandths of points.

The conventional name for this measurement unit is 'm' and 72270 m = 1 inch.

Example

When adding a frame to a Fred page by a script, the command Page.AddFrameEx expects the values in millipoints. Thus:

Page.AddFrameEx(0,0,72270,72270,0)

adds a frame 1 inch wide, 1 inch deep and positioned at the top-left corner of the page.

As an alternative, you can specify:

Page.AddFrameEx(0,0,Units.toVal("1in"),Units.ToVal("1in"),0)

to achieve the same result.