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,nd_1st,'Enter 1st Node',0
*cset,10,12,nd_2nd,'Enter 2nd Node',0
*cset,61,62,'Calculates the X,Y,Z and abs','olute (linear) distance'
*cset,63,64,'between 2 nodes. Enter',' the node numbers.'
multipro,'end'
*if,nd_1st,eq,0,then
*if,nd_2nd,eq,0,then
/ui,nsel
get_min_entity
get_max_entity
*get,ncount_,node,,count
nd_1st=n_min
nd_2nd=nm
grphpic_=1
*endif
*endif
*if,grphpic_,eq,0,then
nd1_=nsel(nd_1st)
nd2_=nsel(nd_2nd)
*if,nd1_,eq,1,then
*if,nd2_,eq,1,then
ncount_=2
*else
ncount_=1
*endif
*else
*if,nd2_,eq,1,then
ncount_=1
*else
ncount_=0
*endif
*endif
*endif
*if,ncount_,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,nd_1st,ne,0,then
*if,nd_2nd,ne,0,then
*if,prec_,le,0,then
prec_=4
*endif
tol_=10**(-prec_-1)
dx__=abs(nx(nd_1st)-nx(nd_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(ny(nd_1st)-ny(nd_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(nz(nd_1st)-nz(nd_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__=distnd(nd_1st,nd_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,%nd_1st%,%nd_2nd%,%dx__%,%dy__%,%dz__%,%dabs__%
Distance Between Node
%/&
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,ncount_,gt,2,then
*msg,warn
Too Many Nodes Picked. Must Select 2 Nodes Only.
*elseif,ncount_,lt,2,then
*msg,warn
Not Enough Nodes Picked. Must Select 2 Nodes Only.
*endif
entity_group,1
*set,grphpic_,
*set,nd1_,
*set,nd2_,
*set,nd_1st,
*set,nd_2nd,
*set,prec_,
*set,ncount_,
*if,prkey_,eq,1,then
/go
*endif