Macro Language Reference > Macros > System > unit
  
unit
Description
Adds user-defined units of measurement to the options already set in PTC ALD. PTC ALD default units of measurement are defined in the ssys.3ad file as shown below.
 
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 unit macros in the document's autoexec script.
 
Example 254. Disable the cicero unit of measurement
To disable the cicero unit of measurement, for example, enter the following macro:
unit 1
Syntax
unit number:n abb1:s? ( abb2:s longname:s base:n two_part_link:n min:f unit_size:f )
number
The unit type to be defined: a number between 1 and 12. Units 1 to 7 are PTC ALD default system units.
Any of PTC ALD default units of measurement can be cleared by entering unit followed by the appropriate number and no further parameters. This can make some dialog boxes less daunting.
abb1
A two-character string representing the unit abbreviation (e.g. "in" for inches). This abbreviation is used when entering unit measurements in PTC ALD .
abb2
An alternative abbreviation for the same measurement: intended for use on non-English systems where the abbreviations need to be translated.
longname
The long name of the measurement: a string of up to 12 characters. This name is used in the Document Preferences and Ruler dialog boxes.
base
The natural 'divisor' for this measurement. This will be used on rulers for tick marks and to calculate the second part of two-part units.
two_part_link
Set a link to the 2nd part of a two-part unit, defined here (e.g. "pc" would link to "pt" and "cc" would link to "dd").
min
A minimum size for the unit (in mm): the unit will not be used when in non-strict mode unless it is less than this minimum
unit_size
A floating point number accurate to many decimal places which specifies the size in millimeters of the unit.
Additional Information
An extract from the ssys.3ad file is shown below:
'unit definitions
'unit num(1..13),abb1,abb2,longname,base,two_part_link,
min(mm), unit_size(mm)
unit 1 ,"cc","cc","cicero",12,7,30,4.5134837925
unit 2 ,"mm","mm","mm",10,0,0 ,1.0
unit 3 ,"cm","cm","cm" ,10,0,30,10.0
unit 4 ,"in","in","inch",10,0,0 ,25.4
unit 5 ,"pt","pt","point" ,12,0,0 ,0.35145980351
unit 6 ,"pc","pc","pica" ,12,5,30,4.2175176422
unit 7 ,"dd","dd","didot" ,12,0,0 ,0.37612364938

'built-in support for PTC ALD internal units,deci-microns
unit 13,"dm","dm","dm" ,10,0,214748.3647,0.0001

'examples of user-defined units
'unit 8 ,"tn","tn","10ths",10,0,0,2.54
'unit 9 ,"sx","sx","6ths",6,0,0,4.23333333333
'unit 10,"tf","tf","24ths",24,0,0,1.05833333333
'unit 11,"st","st","16ths",16,0,0 ,1.5875
'unit 12,"tt","tt","32nds",32,0,0 ,0.79375
'unit 8,"ft","ft","feet",12,4,0,304.8
Related Links