NOTE
*get,prkey_,active,0,prkey
/nopr
tol_=0.0001
prec_=4
cm,kset1__,kp
*get,acs1__,active,,csys
grphpic_=0
multipro,'start',2
*cset,1,3,csnum__,'Enter C.S.
*cset,4,6,kpt__,'Enter KP
*cset,7,9,prec_,'Enter Decimal Precision',4
*cset,61,62,'Calculates the coordinate dist','ances of a keypoint relative'
*cset,63,64,'to a specified C.S. Enter',' the C.S. and KP numbers.'
multipro,'end'
*if,kpt__,eq,0,then
/ui,ksel
get_max_entity
*get,kcount_,kp,,count
kpt__=km
grphpic_=1
*endif
*if,grphpic_,eq,0,then
kp1_=ksel(kpt__)
*if,kp1_,eq,1,then
kcount_=1
*else
kcount_=0
*endif
*endif
*if,kcount_,eq,1,then
*if,prec_,le,0,then
prec_=4
*endif
tol_=10**(-prec_-1)
csys,csnum__
dx__=kx(kpt__)
*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__=ky(kpt__)
*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__=kz(kpt__)
*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
*get,csnumtyp,cdsy,csnum__,attr,kcs
*if,csnumtyp,eq,0,then
dabs__=sqrt(((dx__**2))+((dy__**2))+((dz__**2)))
*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,%csnum__%,%kpt__%,%dx__%,%dy__%,%dz__%,%dabs__%
Coordinates ( CS %i , KP %i ) : %/&
%/&
X = %g %/&
Y = %g %/&
Z = %g %/&
%/&
D = %g
*set,dabs__,
*else
*if,csnumtyp,eq,1,then
*msg,ui,%csnum__%,%kpt__%,%dx__%,%dy__%,%dz__%
Coordinates ( CS %i , KP %i ) : %/&
%/&
R = %g %/&
THETA = %g %/&
Z = %g %/&
*elseif,csnumtyp,eq,2,then
*msg,ui,%csnum__%,%kpt__%,%dx__%,%dy__%,%dz__%
Coordinates ( CS %i , KP %i ) : %/&
%/&
R = %g %/&
THETA = %g %/&
PHI = %g %/&
*else
*msg,ui,%csnum__%,%kpt__%,%dx__%,%dy__%,%dz__%
Coordinates ( CS %i , KP %i ) : %/&
%/&
X = %g %/&
Y = %g %/&
Z = %g %/&
*endif
*endif
*elseif,kcount_,gt,1,then
*msg,warn
Too Many KP's Picked. Must Select 1 KP Only.
*elseif,kcount_,lt,1,then
*msg,warn
No KP Selected. Must Select 1 KP Only.
*endif
init_entity_num
csys,acs1__
cmsel,s,kset1__
/replot
*set,csnum__,
*set,kpt__,
*set,dx__,
*set,dy__,
*set,dz__,
*set,csnumtyp,
*set,acs1__,
*set,tol_,
*set,prec_,
*set,kp1_,
*set,kcount_,
*set,grphpic_,
cmdele,kset1__
*if,prkey_,eq,1,then
/go
*endif