! TITLE: cir_vol_pattern.mac (SM_TOOL) ! ! ! This macro creates a pattern of volumes by repeating an area, or selected ! set of volumes, about the center of the active coordinate system (CS). ! ! The active CS may be any type of CS (i.e., cartesian, cylindrical, etc.). ! The origin of the active CS only serves as a center of rotation for the ! area pattern. Only the existing area(s) which are to be patterned should ! be selected. They are stored in a component group and their pattern ! repeated about the center of the active CS. ! ! The pattern of volumes may be created by either specifying the number of ! patterns, or by specifying the repeat angle of the pattern. In addition, ! the total pattern angle defaults to 360, or a total pattern angle between ! 0 and 360 may be specified. ! ! The arguments for this macro are as follows: ! ! (1) num_pats = The number of repeat patterns to be created ! within the total pattern angle. When specifying ! this parameter, argument 2 (ANG_INC) must be ! left blank. ! ! (2) ang_inc = The angle between repeated area patterns. Specifying ! this parameter over-rides argument 1 (NUM_PATS), ! and will use this value to create the pattern. This ! parameter must be an integral divisor of the total ! pattern angle (PAT_ANG). ! ! (3) pat_ang = The total pattern angle. This parameter defaults ! to 360, but may be specified with an angle value ! between 0 and 360. ! ! ! ! (1) (2) (3) ! CIR_VOL_PATTERN, num_pats, ang_inc, pat_ang ! ! *get,prkey_,active,0,prkey /nopr ! numpats_=arg1 anginc_=arg2 patang_=arg3 ! cm,sourcev_,volu ! *get,basecs_,active,,csys patcs_=basecs_ *get,ccstyp_,cdsy,basecs_,attr,kcs ! *if,ccstyp_,ne,1,then create_cs,0,'patcs_',1,0,0,0,0,0,0 *endif ! *if,patang_,eq,0,then patang_=360 *elseif,patang_,ge,360,then patang_=360 *endif ! *if,anginc_,eq,0,then *if,patang_,eq,360,then anginc_=patang_/numpats_ voffset_=2*anginc_ *else anginc_=patang_/(numpats_-1) voffset_=anginc_ *endif *else *if,patang_,eq,360,then voffset_=2*anginc_ *else voffset_=anginc_ *endif *endif ! vlnum_=0 ! *do,xyz_,0,(patang_-voffset_),anginc_ ! csys,patcs_ ! vlnum_=vlnum_+1 ! clocal,csn+5,1,0,0,0,vlnum_*anginc_,0,0 ! csys,patcs_ ! vtran,csn+5,sourcev_,,,,0,0 ! init_entity_num *enddo ! vlnum_=vlnum_+1 ! vsel,s,volu,,vm-(vlnum_-1),vm,1 cm,vpatrn_,volu ! init_entity_num ! csdele,csn+5 csys,basecs_ ! lplot ! *set,numpats_, *set,anginc_, *set,voffset_, *set,radpat_, *set,strtang_, *set,patang_, *set,vlnum_, *set,xyz_, *set,basecs_, *set,patcs_, *set,ccstyp_, cmdele,sourcev_ *if,prkey_,eq,1,then /go *endif