!   TITLE:  ar_plane_cut.mac (CALCULATION)
!
!
!   OBJECTIVE:
!
!   This macro cuts through a selected set of volumes at a plane coincident
!   with a specified area.
!
!
!   COMMAND SYNTAX:
!
!       AR_PLANE_CUT, area
!
!
!   ARGUMENTS:
!
!       area = the area whose plane is the volume cutting plane.
!
!
!   DESCRIPTION:
!
!   The selected area is used to create a volume cutting plane that is coplanar
!   with the area. The specified area must be a flat (cartesian planar surface.
!
!
!
!
*get,prkey_,active,0,prkey
/nopr

ar_=arg1
!
*get,acs1_,active,,csys
!
asel,s,area,,ar_
asum
lsla,s
ksll,s
get_max_entity
get_min_entity
*get,kcnt_,kp,k_min,nxth
!
*get,acx_,area,,cent,x
*get,acy_,area,,cent,y
*get,acz_,area,,cent,z
!
csys,0
k,,acx_,acy_,acz_
get_max_entity
xypt_=km
!
cskp,csn+5,0,kcnt_,k_min,xypt_
kdele,xypt_
!
norm_cut_pln_ct,'z',0
!
csdele,csn+5
csys,acs1_
!
lplot
!
*set,ar_,
*set,kcnt_,
*set,acs1_,
*set,xypt_,
*set,acx_,
*set,acy_,
*set,acz_,

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