NOTE
*get,prkey_,active,0,prkey
/nopr
entity_group
*get,acs1_,active,,csys
grphpic_=0
multipro,'start',4
*cset,1,3,csnum_,'COORDINATE SYSTEM
*cset,4,6,prec_,'Decimal Precision of Output',4
*cset,7,9,kp_1st,'Enter 1st Keypoint',0
*cset,10,12,kp_2nd,'Enter 2nd Keypoint',0
*cset,61,62,'Calculates the X,Y,Z and abs','olute (linear) distance'
*cset,63,64,'between 2 keypoints. Enter',' the keypoint numbers.'
multipro,'end'
*if,_button,eq,0,then
*if,kp_1st,eq,0,then
*if,kp_2nd,eq,0,then
/ui,ksel
get_min_entity
get_max_entity
*get,kcount_,kp,,count
kp_1st=k_min
kp_2nd=km
grphpic_=1
*endif
*endif
*if,grphpic_,eq,0,then
kp1_=ksel(kp_1st)
kp2_=ksel(kp_2nd)
*if,kp1_,eq,1,then
*if,kp2_,eq,1,then
kcount_=2
*else
kcount_=1
*endif
*else
*if,kp2_,eq,1,then
kcount_=1
*else
kcount_=0
*endif
*endif
*endif
*if,kcount_,eq,2,then
csys,csnum_
*get,csnumtyp,cdsy,csnum_,attr,kcs
*if,csnumtyp,ne,0,then
clocal,csn+1,0,0,0,0,0,0,0
csnum_=csn+1
*endif
*if,kp_1st,ne,0,then
*if,kp_2nd,ne,0,then
*if,prec_,le,0,then
prec_=4
*endif
tol_=10**(-prec_-1)
dx__=abs(kx(kp_1st)-kx(kp_2nd))
*if,abs(dx__),lt,tol_,then
dx__=0
*else
*if,abs(dx__),ge,(10*tol_),then
round_num,dx__,prec_
*else
round_num,dx__,prec_+1
*endif
dx__=num_
*endif
dy__=abs(ky(kp_1st)-ky(kp_2nd))
*if,abs(dy__),lt,tol_,then
dy__=0
*else
*if,abs(dy__),ge,(10*tol_),then
round_num,dy__,prec_
*else
round_num,dy__,prec_+1
*endif
dy__=num_
*endif
dz__=abs(kz(kp_1st)-kz(kp_2nd))
*if,abs(dz__),lt,tol_,then
dz__=0
*else
*if,abs(dz__),ge,(10*tol_),then
round_num,dz__,prec_
*else
round_num,dz__,prec_+1
*endif
dz__=num_
*endif
dabs__=distkp(kp_1st,kp_2nd)
*if,abs(dabs__),lt,tol_,then
dabs__=0
*else
*if,abs(dabs__),ge,(10*tol_),then
round_num,dabs__,prec_
*else
round_num,dabs__,prec_+1
*endif
dabs__=num_
*endif
*msg,ui,%kp_1st%,%kp_2nd%,%dx__%,%dy__%,%dz__%,%dabs__%
Distance Between KP
%/&
Dx = %g %/&
Dy = %g %/&
Dz = %g %/&
%/&
Dabs = %g
*if,csnumtyp,ne,0,then
csdele,csnum_
*endif
csys,acs1_
*set,acs1_,
*set,csnum_,
*set,csnumtyp,
*set,dx__,
*set,dy__,
*set,dz__,
*set,dabs__,
*set,tol_,
*endif
*endif
*elseif,kcount_,gt,2,then
*msg,warn
Too Many KP's Picked. Must Select 2 KP's Only.
*elseif,kcount_,lt,2,then
*msg,warn
Not Enough KP's Picked. Must Select 2 KP's Only.
*endif
*endif
entity_group,1
*set,grphpic_,
*set,kp1_,
*set,kp2_,
*set,kp_1st,
*set,kp_2nd,
*set,prec_,
*set,kcount_,
*if,prkey_,eq,1,then
/go
*endif