Controlling the Precision of the Generated Output
- Last UpdatedDec 09, 2025
- 2 minute read
The precision of both linear and angular data is controlled by the Precision Code (PCODE) attribute. PCODE is an attribute of the DEPT, REGI, DRWG, LIBY, SHLB, OVER and LAYE elements, with its value being cascaded down the database hierarchy. PCODE stores four values of precision for metric (decimal) values, Imperial decimal values, imperial fractional values, and angles. By default, these four values are 0 (dp), 1 (dp), 32nds and 1 (dp) respectively. (dp = decimal places.)
The following are examples of setting PCODE:
|
PCODE LIN MM TO 2 DPLS |
Set linear (metric) precision to two decimal places |
|
PCODE LIN IN TO 2 DPLS |
Set linear (Imperial) precision to two decimal places |
|
PCODE LIN FRA TO 32 NDS |
Set linear (Imperial, fractional) precision to 32nds |
|
PCODE ANG DEG |
Set angular precision to nearest whole number of degrees |
|
PCODE ANG TO 2 DPLS |
Set linear angular precision to two decimal places |
Angles output in degrees, minutes or seconds will be in the standard format (that means, using °, ’ or "). Angles output in the decimal format will have no symbols. If required a ° symbol can be accessed from Draft’s alternative character set by using the code ~0.
Data output in meter or centimeter format will be to the precision specified by the PCODE MM option. Thus if the MM precision is set to 1 dp, output will be set to 4 dp for meter output and 2 dp for centimeter output.
Four pseudo-attributes exist to allow the querying of the individual parts of the PCODE attribute:
|
Q PCODMms |
query metric (mm) precision |
|
Q PCODInches |
query Imperial (inch) precision |
|
Q PCODFractions |
query fraction precision |
|
Q PCODAngles |
query angle precision |