!   TITLE:  slv_lower_az.mac (AAAV)
!
!-----------------------------------------------------------------------
!       Rev -   05/07/2001  D. Edwards
!-----------------------------------------------------------------------
!
!   This macro creates the lower steel sleeve which is bonded into the
!   azimuth gimbal:
!
!         P/N SK375A083 Rev B
!
!
!   CSsl0:    Cartesian Lower Azimuth Gimbal Sleeve Coordinate System
!   CSsl1:  Cylindrical Lower Azimuth Gimbal Sleeve Coordinate System
!   CSsl2:  Spherical Lower Azimuth Gimbal Sleeve Coordinate System
!
!
!************************** TABLE OF CONTENTS **************************
!
!       Model Assembly Preparation
!
!   1.  Parameter List
!   2.  Model Coordinate System
!   3.  Solid Model
!
!
!********************* Model Assembly Preparation **********************
!
mod_assemb_prep,arg1,arg2,arg3
!
!<<<<<<<<<<<<<<<<<<<<<<<< 1.  Parameter List >>>>>>>>>>>>>>>>>>>>>>>>>>
!
slv_lower_az.parm                   ! name of parameter file
!
!<<<<<<<<<<<<<<<<<<<< 2.  Model Coordinate Systems >>>>>>>>>>>>>>>>>>>>
!
mod_coord_system,acs,xc,yc,zc,rotxyc,rotyzc,rotzxc
!
!<<<<<<<<<<<<<<<<<<<<<<<<<<< 3.  Solid Model >>>>>>>>>>>>>>>>>>>>>>>>>>
!

!
! Create revolved cross sectional area
!
csys,CSsl0

k,,0,0,0            ! Rotation axis points
k,,0,0,1

init_entity_num

axp1=km-1
axp2=km

k,,0,Dr01,Dz01
k,,0,Dr01,-Dz02
k,,0,Dr03,-Dz02
k,,0,Dr03,0
k,,0,Dr02,0
k,,0,Dr02,Dz01

create_area

revolve_aset,axp1,axp2,360,4

!
! Cut chamfer
!
csys,CSsl0
create_cs,0,,0,0,-Dy01,-Dz02,-90,-90,0

ang_cut_pln,180-Da01

vdele,vm-3,vm-1,2,1

init_entity_num

lplot

!
! Cut corner off chamfer
!
ang_cut_pln,90,Dy02-Dy01

vdele,vm-3,vm-1,2,1

init_entity_num

lplot

!
! Setup for all holes
!
csys,CSsl0
wpcsys,-1
wpoff,0,0,-Dz02

*afun,deg

!
! Cut screw thru holes with c'bores
!
*if,f_cbore,eq,1,then

cyl4,Dr04*cos(Da02),-Dr04*sin(Da02),Dr10,,,,Dz02
cyl4,Dr04*cos(Da02),-Dr04*sin(Da02),Dr11,,,,Dz11
init_entity_num
vadd,vm-1,vm
init_entity_num

cyl4,Dr04*cos(Da03),Dr04*sin(Da03),Dr10,,,,Dz02
cyl4,Dr04*cos(Da03),Dr04*sin(Da03),Dr11,,,,Dz11
init_entity_num
vadd,vm-1,vm
init_entity_num

vsymm,x,vm-3,vm,3

vsel,s,volu,,vm-3,vm,3
vsel,a,volu,,vm+1,vm+2
cm,vset,volu
vsel,inve
cm,vsl,volu
alls

vsbv,vsl,vset,,delete,delete

init_entity_num

lplot

*endif

!
! Thermal relief holes
!
*if,f_therm,eq,1,then

ang_array,5,Da06,Da06+Da07,90-Da05,90-Da05-Da07,90-Da05-2*Da07

*do,i,1,5
    cyl4,Dr04*cos(ang(i)),Dr04*sin(ang(i)),Dr12,,,,Dz02
*enddo

init_entity_num

vsymm,x,vm-4,vm

vsel,s,volu,,vm-4,vm
vsel,a,volu,,vm+1,vm+5
cm,vset,volu
vsel,inve
cm,vsl,volu
alls

vsbv,vsl,vset,sepo,delete,delete

init_entity_num

lplot

*endif

!
! Threaded holes (Leave solid to fill with steel)
!
*if,f_tap,eq,1,then

cyl4,Dr05*cos(Da04),Dr05*sin(Da04),Dr13,,,,Dz13
cyl4,-Dr05*cos(Da04),Dr05*sin(Da04),Dr13,,,,Dz13
cyl4,0,Dr05,Dr13,,,,Dz13

init_entity_num

vsel,s,volu,,vm-2,vm
cm,vset,volu
vsel,inve
cm,vsl,volu
alls

vsbv,vsl,vset,sepo,delete,keep

init_entity_num

lplot

*endif


finalize_model