!   TITLE:  c_s_position.mac (MANAGEMENT)
!
!
!   This sub-macro calculates the coordinate position stack-up for
!   all of the model coordinate systems in the database assembly. It
!   returns the current c.s. stack-up, XSTACK, YSTACK, ZSTACK; and
!   the previous model stack-up, XSTACK_P, YSTACK_P, ZSTACK_P, from
!   the previous model construction session. In order to track the
!   positional stack-up of an assembly, or subassembly, the parameter
!   'FRST_MDL' must be initialized to 1. At the beginning of all assemblies,
!   FRST_MDL is initialized by default. From this point on, the stack-up will
!   be tracked, until the next time that FRST_MDL is manually initialized.
!
!
*get,prkey_,active,0,prkey
/nopr

*if,frst_mdl,ne,1,then
    xstack_p=xstack             ! previous position stack-up
    ystack_p=ystack
    zstack_p=zstack
    !
    xstack=xstack+xc_mcs        ! present position stack-up
    ystack=ystack+yc_mcs
    zstack=zstack+zc_mcs
*else
    *set,frst_mdl,
*endif


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