!   TITLE:  rec_bore.mac (SM_TOOL)
!
!
!       Expanded macro to include CSKP and pre-existing c.s.;
!       and for explicit input for each KP coordinate.
!
!
!   This sub-macro creates a hexahedral shaped volume which is to be sub-
!   tracted out, thereby creating a rectangular shaped cavity either within
!   or on the surface of the selected volume. This volume may have right
!   angled corners (phibev = 0), or angled (0 < phibev < 90) corners.
!
!   Parameters needed to be passed to this macro are:
!
!       A selected volume(s)
!
!       opt = input options: 1,2,3,4,5,6,7,8,9,10,11 or 12
!
!       p1 = c.s. origin keypoint
!       p2 = c.s. +x axis keypoint
!       p3 = c.s. +y axis keypoint
!
!       xcutc = x component of cut volume local c.s.
!       ycutc = y component of cut volume local c.s.
!       zcutc = z component of cut volume local c.s.
!       rotxyc = 1st orientation angle (+x to +y) of 'reccutcs' c.s.
!       rotyzc = 2nd orientation angle (+y to +z) of 'reccutcs' c.s.
!       rotzxc = 3rd orientation angle (+z to +x) of 'reccutcs' c.s.
!
!       dcut = the depth or thickness of the volume
!       phibev = angle of bevel as measured from the normal
!            to the rectangular surfaces (from volume cut
!            coordinate system z axis)
!       xwcut = width of cut/volume (along local c.s. x axis)
!       yhcut = height of cut/volume (along local c.s. y axis)
!       x23 = x coordinate value for KP's in quadrants 2 and 3
!       x14 = x coordinate value for KP's in quadrants 1 and 4
!       y12 = y coordinate value for KP's in quadrants 1 and 2
!       y34 = y coordinate value for KP's in quadrants 3 and 4
!       acs1= pre-existing Active Coordinate System
!
!   The position and orientation of the volume cut c.s. is measured in
!   relation to the active c.s. for options 1,2,7 and 8 (See below). From
!   this c.s., the local coordinate system building this volume is placed.
!   Options 3,4,9 and 10 allow construction of the cut volume from a c.s.
!   defined by 3 KP's. Lastly, options 5,6,11 and 12 allow construction from
!   a pre-existing c.s.  Options 7 thru 12 correspond to the same input as
!   1 thru 6, except that these options are used when the dimensions of the
!   base rectangle are specified.
!
!
!   The 12 options of input data are summarized as follows:
!
!       1.  Create local c.s. by CLOCAL, input:
!               xcutc, ycutc, zcutc, rotxyc, rotyzc, rotzxc
!
!           Dimensions of rectangle at the surface, input:
!               x23, x14, y12, y34
!
!       2.  Create local c.s. by CLOCAL, input:
!               xcutc, ycutc, zcutc, rotxyc, rotyzc, rotzxc
!
!           Dimensions of rectangle at the surface, input:
!               xwcut, yhcut
!
!       3.  Create local c.s. by CSKP, input:
!               p1, p2, p3
!
!           Dimensions of rectangle at the surface, input:
!               x23, x14, y12, y34
!
!       4.  Create local c.s. by CSKP, input:
!               p1, p2, p3
!
!           Dimensions of rectangle at the surface, input:
!               xwcut, yhcut
!
!       5.  Use pre-existing c.s.,input: acs1
!
!           Dimensions of rectangle at the surface, input:
!               x23, x14, y12, y34
!
!       6.  Use pre-existing c.s.,input: acs1
!
!           Dimensions of rectangle at the surface, input:
!               xwcut, yhcut
!
!       7.  Create local c.s. by CLOCAL, input:
!               xcutc, ycutc, zcutc, rotxyc, rotyzc, rotzxc
!
!           Dimensions of rectangle at the base, input:
!               x23, x14, y12, y34
!
!       8.  Create local c.s. by CLOCAL, input:
!               xcutc, ycutc, zcutc, rotxyc, rotyzc, rotzxc
!
!           Dimensions of rectangle at the base, input:
!               xwcut, yhcut
!
!       9.  Create local c.s. by CSKP, input:
!               p1, p2, p3
!
!           Dimensions of rectangle at the base, input:
!               x23, x14, y12, y34
!
!       10. Create local c.s. by CSKP, input:
!               p1, p2, p3
!
!           Dimensions of rectangle at the base, input:
!               xwcut, yhcut
!
!       11. Use pre-existing c.s.,input: acs1
!
!           Dimensions of rectangle at the base, input:
!               x23, x14, y12, y34
!
!       12. Use pre-existing c.s.,input: acs1
!
!           Dimensions of rectangle at the base, input:
!               xwcut, yhcut
!
!
!
!           (1)   (2)    (3)    (4)    (5)      (6)     (7)   (8)  (9)  (10)
! REC_BORE, opt, xcutc, ycutc, zcutc, rotxyc, rotyzc, rotzxc, x23, x14, y12,
!
!           y34, dcut, phibev
!           (11)  (12)  (13)
!
!
!           (1)   (2)    (3)    (4)    (5)      (6)     (7)    (8)    (9)
! REC_BORE, opt, xcutc, ycutc, zcutc, rotxyc, rotyzc, rotzxc, xwcut, yhcut,
!
!           dcut, phibev
!           (10)   (11)
!
!
!           (1)  (2) (3) (4) (5)  (6)  (7)  (8)  (9)    (10)
! REC_BORE, opt, p1, p2, p3, x23, x14, y12, y34, dcut, phibev
!
!
!           (1)  (2) (3) (4)  (5)    (6)   (7)    (8)
! REC_BORE, opt, p1, p2, p3, xwcut, yhcut, dcut, phibev
!
!
! REC_BORE, opt, acs1, x23, x14, y12, y34, dcut, phibev
!
!
! REC_BORE, opt, acs1, xwcut, yhcut, dcut, phibev
!
!
*get,prkey_,active,0,prkey
/nopr

opt=arg1
!
*if,opt,eq,1,then
    xcutc=arg2
    ycutc=arg3
    zcutc=arg4
    !
    rotxyc=arg5
    rotyzc=arg6
    rotzxc=arg7
    !
    x23=arg8
    x14=arg9
    y12=ar10
    y34=ar11
    dcut=ar12
    phibev=ar13
*endif
!
*if,opt,eq,2,then
    xcutc=arg2
    ycutc=arg3
    zcutc=arg4
    !
    rotxyc=arg5
    rotyzc=arg6
    rotzxc=arg7
    !
    xwcut=arg8
    yhcut=arg9
    dcut=ar10
    phibev=ar11
*endif
!
*if,opt,eq,3,then
    p1=arg2
    p2=arg3
    p3=arg4
    !
    x23=arg5
    x14=arg6
    y12=arg7
    y34=arg8
    dcut=arg9
    phibev=ar10
*endif
!
*if,opt,eq,4,then
    p1=arg2
    p2=arg3
    p3=arg4
    !
    xwcut=arg5
    yhcut=arg6
    dcut=arg7
    phibev=arg8
*endif
!
*if,opt,eq,5,then
    acs1=arg2
    !
    x23=arg3
    x14=arg4
    y12=arg5
    y34=arg6
    dcut=arg7
    phibev=arg8
*endif
!
*if,opt,eq,6,then
    acs1=arg2
    !
    xwcut=arg3
    yhcut=arg4
    dcut=arg5
    phibev=arg6
*endif
!
*if,opt,eq,7,then
    xcutc=arg2
    ycutc=arg3
    zcutc=arg4
    !
    rotxyc=arg5
    rotyzc=arg6
    rotzxc=arg7
    !
    x23=arg8
    x14=arg9
    y12=ar10
    y34=ar11
    dcut=ar12
    phibev=ar13
    !
    x=dcut*tan(phibev*rconv)
    !
    x23=x23+x
    x14=x14+x
    y12=y12+x
    y34=y34+x
*endif
!
*if,opt,eq,8,then
    xcutc=arg2
    ycutc=arg3
    zcutc=arg4
    !
    rotxyc=arg5
    rotyzc=arg6
    rotzxc=arg7
    !
    xwcut=arg8
    yhcut=arg9
    dcut=ar10
    phibev=ar11
    !
    x=dcut*tan(phibev*rconv)
    !
    xwcut=xwcut+2*x
    yhcut=yhcut+2*x
*endif
!
*if,opt,eq,9,then
    p1=arg2
    p2=arg3
    p3=arg4
    !
    x23=arg5
    x14=arg6
    y12=arg7
    y34=arg8
    dcut=arg9
    phibev=ar10
    !
    x=dcut*tan(phibev*rconv)
    !
    x23=x23+x
    x14=x14+x
    y12=y12+x
    y34=y34+x
*endif
!
*if,opt,eq,10,then
    p1=arg2
    p2=arg3
    p3=arg4
    !
    xwcut=arg5
    yhcut=arg6
    dcut=arg7
    phibev=arg8
    !
    x=dcut*tan(phibev*rconv)
    !
    xwcut=xwcut+2*x
    yhcut=yhcut+2*x
*endif
!
*if,opt,eq,11,then
    acs1=arg2
    !
    x23=arg3
    x14=arg4
    y12=arg5
    y34=arg6
    dcut=arg7
    phibev=arg8
    !
    x=dcut*tan(phibev*rconv)
    !
    x23=x23+x
    x14=x14+x
    y12=y12+x
    y34=y34+x
*endif
!
*if,opt,eq,12,then
    acs1=arg2
    !
    xwcut=arg3
    yhcut=arg4
    dcut=arg5
    phibev=arg6
    !
    x=dcut*tan(phibev*rconv)
    !
    xwcut=xwcut+2*x
    yhcut=yhcut+2*x
*endif
!
get_max_entity
!
cm,v2bcut,volu      ! selected volume to be (2b) cut
!
*if,opt,eq,1,then
    create_cs,0,'reccutcs',0,xcutc,ycutc,zcutc,rotxyc,rotyzc,rotzxc
*endif
!
*if,opt,eq,2,then
    create_cs,0,'reccutcs',0,xcutc,ycutc,zcutc,rotxyc,rotyzc,rotzxc
*endif
!
*if,opt,eq,3,then
    create_cs,1,'reccutcs',0,p1,p2,p3
*endif
!
*if,opt,eq,4,then
    create_cs,1,'reccutcs',0,p1,p2,p3
*endif
!
*if,opt,eq,5,then
    csys,acs1
*endif
!
*if,opt,eq,6,then
    csys,acs1
*endif
!
*if,opt,eq,7,then
    create_cs,0,'reccutcs',0,xcutc,ycutc,zcutc,rotxyc,rotyzc,rotzxc
*endif
!
*if,opt,eq,8,then
    create_cs,0,'reccutcs',0,xcutc,ycutc,zcutc,rotxyc,rotyzc,rotzxc
*endif
!
*if,opt,eq,9,then
    create_cs,1,'reccutcs',0,p1,p2,p3
*endif
!
*if,opt,eq,10,then
    create_cs,1,'reccutcs',0,p1,p2,p3
*endif
!
*if,opt,eq,11,then
    csys,acs1
*endif
!
*if,opt,eq,12,then
    csys,acs1
*endif
!
*if,opt,eq,2,then
    k,,-xwcut/2,-yhcut/2,0
    k,,xwcut/2,-yhcut/2,0
    k,,xwcut/2,yhcut/2,0
    k,,-xwcut/2,yhcut/2,0
*endif
!
*if,opt,eq,4,then
    k,,-xwcut/2,-yhcut/2,0
    k,,xwcut/2,-yhcut/2,0
    k,,xwcut/2,yhcut/2,0
    k,,-xwcut/2,yhcut/2,0
*endif
!
*if,opt,eq,6,then
    k,,-xwcut/2,-yhcut/2,0
    k,,xwcut/2,-yhcut/2,0
    k,,xwcut/2,yhcut/2,0
    k,,-xwcut/2,yhcut/2,0
*endif
!
*if,opt,eq,1,then
    k,,-x23,-y34,0
    k,,x14,-y34,0
    k,,x14,y12,0
    k,,-x23,y12,0
*endif
!
*if,opt,eq,3,then
    k,,-x23,-y34,0
    k,,x14,-y34,0
    k,,x14,y12,0
    k,,-x23,y12,0
*endif
!
*if,opt,eq,5,then
    k,,-x23,-y34,0
    k,,x14,-y34,0
    k,,x14,y12,0
    k,,-x23,y12,0
*endif
!
*if,opt,eq,8,then
    k,,-xwcut/2,-yhcut/2,0
    k,,xwcut/2,-yhcut/2,0
    k,,xwcut/2,yhcut/2,0
    k,,-xwcut/2,yhcut/2,0
*endif
!
*if,opt,eq,10,then
    k,,-xwcut/2,-yhcut/2,0
    k,,xwcut/2,-yhcut/2,0
    k,,xwcut/2,yhcut/2,0
    k,,-xwcut/2,yhcut/2,0
*endif
!
*if,opt,eq,12,then
    k,,-xwcut/2,-yhcut/2,0
    k,,xwcut/2,-yhcut/2,0
    k,,xwcut/2,yhcut/2,0
    k,,-xwcut/2,yhcut/2,0
*endif
!
*if,opt,eq,7,then
    k,,-x23,-y34,0
    k,,x14,-y34,0
    k,,x14,y12,0
    k,,-x23,y12,0
*endif
!
*if,opt,eq,9,then
    k,,-x23,-y34,0
    k,,x14,-y34,0
    k,,x14,y12,0
    k,,-x23,y12,0
*endif
!
*if,opt,eq,11,then
    k,,-x23,-y34,0
    k,,x14,-y34,0
    k,,x14,y12,0
    k,,-x23,y12,0
*endif
!
x=dcut*tan(phibev*rconv)
!
*if,opt,eq,2,then
    !
    *if,(xwcut/2-x),gt,0,then
        !
        *if,(yhcut/2-x),gt,0,then
            !
            k,,-(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),(yhcut/2-x),-dcut
            k,,-(xwcut/2-x),(yhcut/2-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,4,then
    !
    *if,(xwcut/2-x),gt,0,then
        !
        *if,(yhcut/2-x),gt,0,then
            !
            k,,-(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),(yhcut/2-x),-dcut
            k,,-(xwcut/2-x),(yhcut/2-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,6,then
    !
    *if,(xwcut/2-x),gt,0,then
        !
        *if,(yhcut/2-x),gt,0,then
            !
            k,,-(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),(yhcut/2-x),-dcut
            k,,-(xwcut/2-x),(yhcut/2-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,1,then
    !
    *if,(x14-x),gt,-(x23-x),then
        !
        *if,(y12-x),gt,-(y34-x),then
            !
            k,,-(x23-x),-(y34-x),-dcut
            k,,(x14-x),-(y34-x),-dcut
            k,,(x14-x),(y12-x),-dcut
            k,,-(x23-x),(y12-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,3,then
    !
    *if,(x14-x),gt,-(x23-x),then
        !
        *if,(y12-x),gt,-(y34-x),then
            !
            k,,-(x23-x),-(y34-x),-dcut
            k,,(x14-x),-(y34-x),-dcut
            k,,(x14-x),(y12-x),-dcut
            k,,-(x23-x),(y12-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,5,then
    !
    *if,(x14-x),gt,-(x23-x),then
        !
        *if,(y12-x),gt,-(y34-x),then
            !
            k,,-(x23-x),-(y34-x),-dcut
            k,,(x14-x),-(y34-x),-dcut
            k,,(x14-x),(y12-x),-dcut
            k,,-(x23-x),(y12-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,8,then
    !
    *if,(xwcut/2-x),gt,0,then
        !
        *if,(yhcut/2-x),gt,0,then
            !
            k,,-(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),(yhcut/2-x),-dcut
            k,,-(xwcut/2-x),(yhcut/2-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,10,then
    !
    *if,(xwcut/2-x),gt,0,then
        !
        *if,(yhcut/2-x),gt,0,then
            !
            k,,-(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),(yhcut/2-x),-dcut
            k,,-(xwcut/2-x),(yhcut/2-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,12,then
    !
    *if,(xwcut/2-x),gt,0,then
        !
        *if,(yhcut/2-x),gt,0,then
            !
            k,,-(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),-(yhcut/2-x),-dcut
            k,,(xwcut/2-x),(yhcut/2-x),-dcut
            k,,-(xwcut/2-x),(yhcut/2-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,7,then
    !
    *if,(x14-x),gt,-(x23-x),then
        !
        *if,(y12-x),gt,-(y34-x),then
            !
            k,,-(x23-x),-(y34-x),-dcut
            k,,(x14-x),-(y34-x),-dcut
            k,,(x14-x),(y12-x),-dcut
            k,,-(x23-x),(y12-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,9,then
    !
    *if,(x14-x),gt,-(x23-x),then
        !
        *if,(y12-x),gt,-(y34-x),then
            !
            k,,-(x23-x),-(y34-x),-dcut
            k,,(x14-x),-(y34-x),-dcut
            k,,(x14-x),(y12-x),-dcut
            k,,-(x23-x),(y12-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
*if,opt,eq,11,then
    !
    *if,(x14-x),gt,-(x23-x),then
        !
        *if,(y12-x),gt,-(y34-x),then
            !
            k,,-(x23-x),-(y34-x),-dcut
            k,,(x14-x),-(y34-x),-dcut
            k,,(x14-x),(y12-x),-dcut
            k,,-(x23-x),(y12-x),-dcut
            !
            init_entity_num
            !
            v,km-7,km-6,km-5,km-4,km-3,km-2,km-1,km
            !
            init_entity_num
            !
            vsbv,v2bcut,vm,,delete,delete
            !
            init_entity_num
        *else
            init_entity_num
            !
            kdele,km-3,km,1
            csdele,csn
            csn=csn-1
            !
            init_entity_num
        *endif
    *else
        init_entity_num
        !
        kdele,km-3,km,1
        csdele,csn
        csn=csn-1
        !
        init_entity_num
    *endif
*endif
!
lplot
!
*set,xcutc, ! undefine parameters
*set,ycutc,
*set,zcutc,
*set,opt,
*set,acs1,
*set,rotxyc,
*set,rotyzc,
*set,rotzxc,
*set,x23,
*set,x14,
*set,y12,
*set,y34,
*set,phibev,
*set,dcut
*set,xwcut
*set,yhcut
*set,x,

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