NOTE
*get,prkey_,active,0,prkey
/nopr
entity_group
*get,acs1_,active,,csys
multipro,'start',4
*cset,1,3,csnum_,'COORDINATE SYSTEM
*cset,4,6,prec_,'Decimal Precision of Output',4
*cset,7,9,ln_1st,'Enter 1st Line',0
*cset,10,12,ln_2nd,'Enter 2nd Line',0
*cset,61,62,'Calculates the minimum distance',' between two lines.'
*cset,63,64,'If lines cross, the intersection',' coordinates are displayed'
multipro,'end'
*if,prec_,lt,0,then
prec_=4
*endif
*if,ln_1st*ln_2nd,le,0,then
/ui,lsel
get_min_entity
get_max_entity
ln_1st=l_min
ln_2nd=lm
*get,lcount_,line,,count
*else
lcount_=lsel(ln_1st)+lsel(ln_2nd)
*endif
*if,lcount_,eq,2,then
csys,csnum_
ln_dist_ln,ln_1st,ln_2nd
*if,err_,eq,1,then
round_num,xi_,prec_
xi_=num_
round_num,yi_,prec_
yi_=num_
round_num,zi_,prec_
zi_=num_
*get,cstyp_,cdsy,csnum_,attr,kcs
*if,cstyp_,eq,0,then
*msg,ui,ln_1st,ln_2nd,xi_,yi_,zi_,csnum_
Lines %i and %i intersect at : %/&
%/&
X = %g %/&
Y = %g %/&
Z = %g %/&
%/&
CS = %g (cartesian coordinates)
*elseif,cstyp_,eq,1,then
*msg,ui,ln_1st,ln_2nd,xi_,yi_,zi_,csnum_
Lines %i and %i intersect at : %/&
%/&
R = %g %/&
THETA = %g %/&
Z = %g %/&
%/&
CS = %g (cylindrical coordinates)
*else
*msg,ui,ln_1st,ln_2nd,xi_,yi_,zi_,csnum_
Lines %i and %i intersect at : %/&
%/&
R = %g %/&
THETA = %g %/&
PHI = %g %/&
%/&
CS = %g (spherical coordinates)
*endif
*set,cstyp_
*elseif,err_,eq,2,then
round_num,dist_,prec_
dist_=num_
*msg,ui,ln_1st,ln_2nd,dist_
Minimum distance between lines %i and %i : %/&
%/&
D = %g
*else
round_num,dist_,prec_
dist_=num_
*msg,ui,ln_1st,ln_2nd,dist_
Lines %i and %i are parallel : %/&
%/&
D = %g
*endif
csys,acs1_
*set,acs1_
*set,csnum_
*set,num_
*set,xi_,
*set,yi_,
*set,zi_,
*set,dist_
*set,err_
*elseif,lcount_,gt,2,then
*msg,warn
Too Many lines's Picked. Must Select 2 lines's Only.
*else
*msg,warn
Not Enough lines's Picked. Must Select 2 lines's Only.
*endif
entity_group,1
*set,ln_1st
*set,ln_2nd
*set,prec_
*set,lcount_
*if,prkey_,eq,1,then
/go
*endif