!   TITLE:  radial_vsel.mac (MANAGEMENT)
!
!
!   OBJECTIVE:
!
!   This sub-macro selects a volume, or set of volumes, by radial position.
!
!   COMMAND SYNTAX:
!
!                      (1)   (2)   (3)   (4)    (5)   (6)    (7)   (8)
!        RADIAL_VSEL, stype, acs, rlow, rhigh, alow, ahigh, zlow, zhigh
!
!
!   ARGUMENTS:
!
!       (1) stype = label outlining the selection type
!
!                   'u' = unselect
!                   's' = select
!                   'r' = reselect
!
!       (2) acs = active cylindrical C.S. in which selection process occurs
!
!       (3) rlow = lower limit radius of envelope
!
!       (4) rhigh = upper limit radius of envelope
!
!       (5) alow = lower limit angle of envelope
!
!       (6) ahigh = upper limit angle of envelope
!
!       (7) zlow = lower limit axial position of envelope
!
!       (8) zhigh = upper limit axial position of envelope
!
!
!   DESCRIPTION:
!
!   This macro allows a user to specify radial and angular position limits
!   of a volume(s) without knowledge of the volume centroid.  It is useful for
!   arc-shaped volumess where the centoid is not located within the volume
!   boundaries.
!
!   This macro uses the keypoint positions and their attached lines to select,
!   reselect and unselect the area(s), and therefore the volumes in question.
!   Therefore, the envelope containing the volume boundary keypoints is used
!   to either select, unselect or reselect the desired volumes(s).
!
!
!
!
*get,prkey_,active,0,prkey
/nopr

cm,kset2_,kp
cm,lset2_,line
cm,aset2_,area
!
cm,vset1_,volu
!
typ_=arg1
acs_=arg2
rlow_=arg3
rhigh_=arg4
alow_=arg5
ahigh_=arg6
zlow_=arg7
zhigh_=arg8
!
!
*get,actcs_,active,,csys
!
csys,acs_
!
ksel,s,loc,x,rlow_,rhigh_
ksel,r,loc,y,alow_,ahigh_
ksel,r,loc,z,zlow_,zhigh_
!
lslk,s,1
!
*if,typ_,eq,'r',then
    asll,r,1
    vsla,r,1
*else
    asll,s,1
    vsla,s,1
*endif
!
*get,vcount_,volu,,count
!
*if,vcount_,eq,0,then
    *if,typ_,eq,'r',then
        asll,r,0
        vsla,r,0
    *else
        asll,s,0
        vsla,s,0
    *endif
*endif
!
*if,typ_,eq,'u',then
    cm,vset2_,volu
    cmsel,s,vset1_
    cmsel,u,vset2_
*endif
!
cmsel,s,kset2_
cmsel,s,lset2_
cmsel,s,aset2_
!
csys,actcs_
!
*set,typ_,
*set,vcount_,
*set,actcs_,
*set,acs_,
*set,rlow_,
*set,rhigh_,
*set,alow_,
*set,ahigh_,
*set,zlow_,
*set,zhigh_,
cmdele,vset1_
cmdele,vset2_
cmdele,kset2_
cmdele,lset2_
cmdele,aset2_

*if,prkey_,eq,1,then
    /go
*endif