start

PKGVD

PKGVD ia a macro Get Value command providing control over fixing the decimal place number. Intended to be used inside macros, it returns floating point mathematical expressions with the desired number of decimal places. For best practices, continue to use FastCAS’s native GV while calculating values. PKGVD can be used just prior to displaying results as text inside CAD drawings.

Syntax: PKGVD;VariableName;Real.Expression;DecimalPlaceNumber

In the example macro below, PKGVD sets the display of decimal places for a “Chamfer Dimension Note,” after the calculations are performed. Below that line, the macro controls how to justify the text note depending on how the user draws the path arrow.

macro ChamferDimension
|ECOFF
GL;AddedText; x 45°
GN;DecPl;^D# of Decimal Places: 
GE;Chamfer;^DPick Chamfer Line [Done]: 
iferr;end
GP;MidCham;mids;Chamfer
GDIST;LHyp;%;0;Chamfer;%;100;Chamfer
GSIN;sine45;45
GV;ChamVal;LHyp*sine45
PKGVD;ChamText;ChamVal;DecPL
APND ChamText AddedText
orthoff
PATHA
MidCham
^DArrow 2nd Point Position:
ORTHON
^DEnd Point:;
GP;pt1;@0,0
GETX x1 PT1
GP PT2 % 5 PT1
GETX x2 PT2
GV result x1-x2
IFP result J1
GOTO J2
:J1
TSPECJ
9
GOTO J3
:J2
TSPECJ
10
:J3
TEXTM ChamText
PT1
:end
ECON
endm