!   TITLE:  ms_ldr.mac
!
!---------------------------------------------------------------------------
!       Rev -   RELEASED    08/27/2001      D. Edwards/J. Rinaldi
!---------------------------------------------------------------------------
!
!   This is a macro that builds the AAAV CRES 410 mirror support using
!   the Lincoln Dreher Rounded End configuration.
!
!               P/N: SK400A007
!
!   CSmirsp0:   Cartesian Mirror Support Coordinate System
!   CSmirsp1:   Cylindrical Mirror Support Coordinate System
!   CSmirsp2:   Spherical Mirror Support Coordinate System
!
!
!************************** TABLE OF CONTENTS **************************
!
!      Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Solid Model
!       3.1  Create Initial Profile Volume
!       3.2  Create Top Surface Cut
!       3.3  Create Rib Pockets
!       3.4  Modify Bottom Surface
!           3.4.1  Beveled Rectanglular Cut
!           3.4.2  Beveled Surface Cut
!           3.4.3  Left Beveled Surface Material Cut
!           3.4.4  Balance holes (12 PL)
!       3.5  Center Hole Bores
!           3.5.1  Center Hole
!           3.5.2  Counterbore
!       3.6  Elevation Axis Journals
!           3.6.1  Resolver Journal
!           3.6.2  Torquer Journal
!           3.6.3  Center cut on back (extrude)
!           3.6.4  Chamfer at top edge of feature 3.4.4
!           3.6.5  Balance weight holes (12 PL)
!   4.  FEA Model
!       4.1  Prepare Volumes
!           4.1.1  Long Axis Cut
!           4.1.2  Left Journal Volumes
!           4.1.3  Left Side Rib Volumes
!           4.1.4  Right Side Rib Volumes
!           4.1.5  Short Axis Cut
!           4.1.6  Right Journal Volumes
!           4.1.7  Back Surface Cuts
!           4.1.8  Back Contour Cuts
!           4.1.9  Rib Pocket Contours
!
!
!********************* Model Assembly Preparation **********************
!
mod_assemb_prep,arg1,arg2,arg3      ! prepare database for assembly
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
ms_ldr.parm
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate System >>>>>>>>>>>>>>>>>>>>>
!
mod_coord_system,acs,xc,yc,zc,rotxyc,rotyzc,rotzxc
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 3. Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!
!----------------- 3.1  Create Initial Profile Volume ----------------
!
csys,CSmirsp0
!
!
! Keypoint Definitions from top.parm
!

k,km+1,tpPx1,tpPy1,tpPz1     ! km + 1
k,km+2,tpPx2,tpPy2,tpPz2     ! km + 2
k,km+3,tpPx3,tpPy3,tpPz3     ! km + 3
k,km+4,tpPx4,tpPy4,tpPz4     ! km + 4
k,km+5,tpPx5,tpPy5,tpPz5     ! km + 5
k,km+6,tpPx6,tpPy6,tpPz6     ! km + 6
k,km+7,tpPx7,tpPy7,tpPz7     ! km + 7
k,km+8,tpPx8,tpPy8,tpPz8     ! km + 8
k,km+9,tpPx9,tpPy9,tpPz9     ! km + 9 (center)

!
! Line Definitions
!

L,km+1,km+2                  ! lm + 1
L,km+3,km+4                  ! lm + 2
L,km+5,km+6                  ! lm + 3
L,km+6,km+7                  ! lm + 4
L,km+3,km+2                  ! lm + 5
L,km+1,km+5                  ! lm + 6
L,km+4,km+8                  ! lm + 7
larc,km+7,km+8,km+9,tpDr1    ! lm + 8
!
create_vol-lines,-extd1
!
lplot
!
!----------------------- 3.2  Create Top Surface Cut -------------------
!
csys,CSmirsp0
!
create_cs,0,'CStprof',0,0,-(1.2*h2),0,0,90,0
!
k,,-l1,h4,0                 ! create horizontal surface line
k,,l2,h4,0
!
create_lines,,1
!
create_cs,0,,1,-l1,h3,0,0,0,0
!
k,,l1,-phi2,0               ! create left beveled surface line
k,,l1,180-phi2,0
!
create_lines,,1
!
csys,CStprof                ! create right beveled surface line
!
create_cs,0,,1,l2,h3,0,0,0,0
!
k,,l2,180+phi2,0
k,,l2,phi2,0
!
create_lines,,1
!
lsbl,lm-1,lm-2,,delete,keep
    csys,CSmirsp0       ! left partition distance, for meshing purposes
    pdl=kx(km+1)
    csys,csn
lsbl,lm,lm-2,,delete,delete
    csys,CSmirsp0       ! right partition distance, for meshing purposes
    pdr=kx(km+2)
    csys,csn
lstr,km+1,km+2
ldele,lm+1,lm+3,2,1
!
csys,CStprof
!
k,,kx(km-2),2*extd1,0
k,,kx(km),2*extd1,0
!
init_entity_num
!
lstr,km,km-1
lstr,km-1,km-6
lstr,km,km-4
!
init_entity_num
!
a,km,km-1,km-6,km-3,km-2,km-4
!
init_entity_num
!
voffst,am,-(1.5*(h1+h2))
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
lplot
!
!----------------- 3.3  Create Rib Pockets on Mirror Side -----------------
!
csys,CSmirsp0

!
! Keypoint Definitions from top.parm
!

k,km+1,poPx1,poPy1,poPz1     ! km + 1
k,km+2,poPx2,poPy2,poPz2     ! km + 2
k,km+3,poPx3,poPy3,poPz3     ! km + 3 (center)
k,km+4,poPx4,poPy4,poPz4     ! km + 4
k,km+5,poPx5,poPy5,poPz5     ! km + 5
k,km+6,poPx6,poPy6,poPz6     ! km + 6 (center)
k,km+7,poPx7,poPy7,poPz7     ! km + 7
k,km+8,poPx8,poPy8,poPz8     ! km + 8
k,km+9,poPx9,poPy9,poPz9     ! km + 9 (center)
k,km+10,poPx10,poPy10,poPz10 ! km + 10
k,km+11,poPx11,poPy11,poPz11 ! km + 11 (center)

!
! Line Definitions
!

larc,km+1,km+2,km+3,poDr1    ! lm + 1
L,km+4,km+5                  ! lm + 2
larc,km+5,km+1,km+6,poDr2    ! lm + 3
L,km+7,km+8                  ! lm + 4
larc,km+7,km+4,km+9,poDr3    ! lm + 5
L,km+10,km+2                 ! lm + 6
larc,km+10,km+8,km+11,poDr4  ! lm + 7

create_area-lines

arsym,y,am,,,,1,0

init_entity_num

!
! Keypoint Definitions from top.parm
!

k,km+1,po2Px1,po2Py1,po2Pz1  ! km + 1
k,km+2,po2Px2,po2Py2,po2Pz2  ! km + 2
k,km+3,po2Px3,po2Py3,po2Pz3  ! km + 3
k,km+4,po2Px4,po2Py4,po2Pz4  ! km + 4
k,km+5,po2Px5,po2Py5,po2Pz5  ! km + 5 (center)
k,km+6,po2Px6,po2Py6,po2Pz6  ! km + 6
k,km+7,po2Px7,po2Py7,po2Pz7  ! km + 7
k,km+8,po2Px8,po2Py8,po2Pz8  ! km + 8 (center)
k,km+9,po2Px9,po2Py9,po2Pz9  ! km + 9
k,km+10,po2Px10,po2Py10,po2Pz10 ! km + 10
k,km+11,po2Px11,po2Py11,po2Pz11 ! km + 11 (center)
k,km+12,po2Px12,po2Py12,po2Pz12 ! km + 12 (center)

!
! Line Definitions
!

L,km+1,km+2                  ! lm + 1
L,km+3,km+4                  ! lm + 2
larc,km+1,km+3,km+5,po2Dr1   ! lm + 3
L,km+6,km+7                  ! lm + 4
larc,km+4,km+6,km+8,po2Dr2   ! lm + 5
L,km+9,km+10                 ! lm + 6
larc,km+7,km+10,km+11,po2Dr3 ! lm + 7
larc,km+9,km+2,km+12,po2Dr4  ! lm + 8

create_area-lines

arsym,y,am,,,,1,0

create_cs,0,'CSsymm0',0,(l2-l1)/2,0,0,0,0,0

init_entity_num

voffst,am-3,-(2*extd1-h7)       ! Floor thickness of h7
voffst,am-2,-(2*extd1-h7)
voffst,am-1,2*extd1-h7
voffst,am,2*extd1-h7

init_entity_num

vsel,u,volu,,vm-4
cm,vset1,volu
vsel,a,volu,,vm-4

vsbv,vm-4,vset1,,delete,delete

init_entity_num

lplot
!
!--------------- 3.4  Create Rib Pockets Opposite Mirror ------------------
!

!
!------------------------ 4.4  Modify Bottom Surface ---------------------
!
!
!--------------------- 4.4.1  Beveled Rectanglular Cut -------------------
!
!------------------------ 3.4.2  Beveled Surface Cut ---------------------
!
!
!--------------- 3.4.3  Left Beveled Surface Material Cut ------------
!
!
!------------------------ 3.5  Center Hole Bores ---------------------
!
!
!-------------------------- 3.5.1  Center Hole -----------------------
!
csys,CSmirsp1
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)
    k,,dhole/2,i,-extd1
*enddo
!
create_area,1
!
voffst,am,2*extd1
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
!------------------------ 3.5.2  Counterbore ------------------------
!
csys,CSmirsp1
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)
    k,,dbore1/2,i,2*h4
*enddo
!
create_area,1
!
!voffst,am,-(((2*h4)-h11)+boredpth)
voffst,am,-2*h4+boredpth
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
lplot
!
!-------------------- 3.6  Elevation Axis Journals -------------------
!
!----------------------- 3.6.1  Resolver Journal ---------------------
!
!
csys,CSmirsp0
!
create_cs,0,'CSm_res1',1,-l1,0,h11,0,0,-90
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)
    k,,dlj/2,i,0
*enddo
!
create_area,1
!
voffst,am,extd2
!
init_entity_num
!
vadd,vm-1,vm
!
init_entity_num
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! machine inner bore
    k,,dbore2/2,i,1.2*extd2
*enddo
!
create_area,1
!
voffst,am,-(0.2*extd2+extd3)
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)     ! machine outer surface
    k,,1.2*dlj/2,i,1.2*extd2
*enddo
!
create_area,1
!
*do,i,0,3*((pi/2)*dconv),((pi/2)*dconv)
    k,,dos/2,i,1.2*extd2
*enddo
!
create_area,1
!
asba,am-1,am,,delete,delete
!
init_entity_num
!
voffst,am,-(0.2*extd2+extd4)
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num
!
lplot
!
!----------------------- 3.6.2  Torquer Journal ----------------------
!
!*go,:skip
csys,CSmirsp0
!
create_cs,0,,1,l2-.8*thick,0,h11,0,0,90
!
extd5=extd5+.8*thick            ! Needed for round end only
!
create_circle,drj/2                         ! 1st volume
!
create_vol-lines,extd5
!
create_circle,d1/2,extd5                    ! 2nd volume
!
create_vol-lines,l18/2
!
asel,selv,loc,z,extd5+l18/2
lstr,km,km-2
lstr,km-1,km-3

asbl,all,lm+1,delete,delete
asbl,all,lm+2,delete,delete
!
init_entity_num
!
create_circle,d2/2,l18+extd5                ! 3rd volume
!
create_vol-lines,l19
!
create_circle,d3/2,l19+l18+extd5            ! 4th volume
!
create_vol-lines,l20
!
create_circle,d4/2,l20+l19+l18+extd5        ! 5th volume
!
create_vol-lines,l21
!
vadd,vm-5,vm-4,vm-3,vm-2,vm-1,vm
!
vadd,vm-1,vm
!

init_entity_num
!
lplot

csys,CSmirsp0
extd5=extd5-.8*thick            ! Needed for round end only
create_cs,0,'CSm_trq1',1,l2,0,h11,0,0,90

! Trim torquer journal
csys,CSmirsp0
create_cs,0,'CSm_trq0',0,l2,0,h11,0,0,90

dtrim=h3-h11-.02
k,,-dtrim,drj,0
k,,-dtrim,drj,-thick
k,,-dtrim,-drj,-thick
k,,-dtrim,-drj,0
!
create_area
!
voffst,am,drj
!
init_entity_num
!
vsbv,vm-1,vm,,delete,delete
!
init_entity_num

lplot

!
!------------------ 3.6.3  Center cut on back (extrude) -----------------
!
csys,CSmirsp0

k,km+1,ccPx1,ccPy1,ccPz1     ! km + 1
k,km+2,ccPx2,ccPy2,ccPz2     ! km + 2
k,km+3,ccPx3,ccPy3,ccPz3     ! km + 3
k,km+4,ccPx4,ccPy4,ccPz4     ! km + 4
k,km+5,ccPx5,ccPy5,ccPz5     ! km + 5
k,km+6,ccPx6,ccPy6,ccPz6     ! km + 6
k,km+7,ccPx7,ccPy7,ccPz7     ! km + 7
k,km+8,ccPx8,ccPy8,ccPz8     ! km + 8
k,km+9,ccPx9,ccPy9,ccPz9     ! km + 9 (center)
k,km+10,ccPx10,ccPy10,ccPz10 ! km + 10
k,km+11,ccPx11,ccPy11,ccPz11 ! km + 11
k,km+12,ccPx12,ccPy12,ccPz12 ! km + 12 (center)
k,km+13,ccPx13,ccPy13,ccPz13 ! km + 13 (center)
k,km+14,ccPx14,ccPy14,ccPz14 ! km + 14 (center)
k,km+15,ccPx15,ccPy15,ccPz15 ! km + 15 (center)
k,km+16,ccPx16,ccPy16,ccPz16 ! km + 16 (center)

!
! Line Definitions
!

L,km+1,km+2                  ! lm + 1
L,km+3,km+4                  ! lm + 2
L,km+5,km+6                  ! lm + 3
larc,km+7,km+8,km+9,ccDr1    ! lm + 4
L,km+10,km+11                ! lm + 5
larc,km+5,km+8,km+12,ccDr2   ! lm + 6
larc,km+7,km+10,km+13,ccDr3  ! lm + 7
larc,km+11,km+1,km+14,ccDr4  ! lm + 8
larc,km+2,km+4,km+15,ccDr5   ! lm + 9
larc,km+3,km+6,km+16,ccDr6   ! lm + 10

create_area-lines

arsym,y,am,,,,1,0

csys,CSsymm0

arsym,x,am,am+1,1,,1,0

init_entity_num

*do,i,am-3,am,1
    voffst,i,ccDext
*enddo

init_entity_num

vsel,u,volu,,vm-4
cm,vset1,volu
vsel,a,volu,,vm-4

vsbv,vm-4,vset1,,delete,delete

init_entity_num

lplot

!
!-------------- 3.6.4  Chamfer at top edge of feature 3.4.4 -----------
!
!------------------ 3.6.5  Balance weight holes (12 PL) ---------------
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 4.  FEA Model >>>>>>>>>>>>>>>>>>>>>>>>>
!
!----------------------- 4.1  Prepare Volumes ----------------------
!
!

finalize_model

save

fini

/psearch,e:/sl/ansys/ansys/aaav/elev_axis

/prep7

:skip