DRAW Reference Manual
Intelligent Text
:
Distance, Position and Bore Data Output
: Controlling the Precision of the Generated Output
Controlling the Precision of the Generated Output
The precision of both linear and angular data is controlled by the Precision Code (PCODE) attribute. PCODE is used primarily in DRAW via the visual style elements. Historically it is also 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 (mm dp), 1 (dp), 32nds and 1 (dp) respectively. (dp = decimal places.)
In addition, it is possible to control whether trailing zeros following the decimal point are displayed, using the ‘TRAILING ZEROS’ syntax. This applies to both metric and imperial linear precisions. The default is 'on'. Note that angles never display trailing zeros after the decimal point.
The following are examples of setting PCODE:
PCODE LIN MM TO 2 DPLS
Set linear (metric) precision to two decimal places
PCODE LIN METRES TO 1 DPLS
Set linear (metric) precision to one decimal place on metres
PCODE LIN CM TO 2 DPLS
Set linear (metric) precision to two decimal places on CM
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
PCODE TRAILING ZEROS ON
Ensure trailing zeros are displayed. For example, 175.00 or 200.30
PCODE TRAILING ZEROS OFF
Strip trailing zeros are displayed. For example, 175 or 200.3
Angles output in degrees, minutes or seconds will be in the standard format (i.e. using °, ’ or ”). Angles output in the decimal format will have no symbols. If required a ° symbol can be accessed from DRAW’s alternative character set by using the code ~0.
Data output in linear metric format (mm, cm, metres) will be to the precision derived from the PCODE option currently in force. For example, if the METRE precision is set to 1, output will be 1dp for metres, 3dp for cm and 4dp for mm. In order to control metres and mm independently (for example 1dp for metres and 2dp for mms) it will be necessary to use two different PCODEs. In DRAW this would normally be achieved by having two different visual styles, one used for entities where distance is measured in metres, and one for entities where distance is measured in mm.
Four pseudo-attributes exist to allow the querying of the individual parts of the PCODE attribute:
Q PCODInches
query Imperial (inch) precision
Q PCODFractions
query fraction precision
Q PCODAngles
query angle precision
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.