! TITLE: revolve_aset.mac (SM_TOOL) ! ! ! Allows the option to use a specified coordinate system to revolve around ! Z axis of. This eliminates the necessity for creating keypoints to revolve ! about if they are not already available. ! ! Added code to assign material attributes to volumes or areas. ! ! Added code to assign component name to the new volumes created by this ! command. ! ! OBJECTIVE: ! ! This sub-macro revolves a selected set of areas around an axis defined by ! 2 keypoints, or an axis defined by the Z axis of a specified coordinate ! system. ! ! ! COMMAND SYNTAX: ! ! -- OPTION 1: ! ! (1) (2) (3) (4) ! REVOLVE_ASET, axp1, axp2, revang, numseg ! ! ! -- OPTION 2: ! ! (1) (2) (3) ! REVOLVE_ASET, csnum, revang, numseg ! ! ! ARGUMENTS: ! ! -- OPTION 1: ! ! (1) axp1 = 1st axis point of revolution ! ! (2) axp2 = 2nd axis point of revolution ! ! (3) revang = total angle of revolution of selected areas ! ! (4) numseg = number of volume segments in the revolve angle (revang) ! ! ! -- OPTION 2: ! ! (1) cs = coordinate system whose Z axis is the axis of revolution. ! This C.S. may be a cartesian or cylindrical C.S. ! ! (2) revang = total angle of revolution of selected areas ! ! (3) numseg = number of volume segments in the revolve angle (revang) ! ! ! DESCRIPTION: ! ! -- OPTION 1: ! ! The selected set of areas are revolved about an axis defined by 2 keypoints, ! AXP1 and AXP2. The total angle of revolve is defined by REVANG; and the ! number of volume segments in the revolve are specified by NUMSEG. ! ! ! -- OPTION 2: ! ! The selected set of areas are revolved about the Z axis of a specified co- ! ordinate system. The total angle of revolve is defined by REVANG; and the ! number of volume segments in the revolve are specified by NUMSEG. The rot- ! ation direction is consistent with the vector definition of the right-hand ! rule, with positive rotations counter-clockwise about the positive Z axis. ! ! -- GENERAL: ! ! Either option is exercised by the algorithm automatically. When the 4th ! argument is used, i.e., the total number of revolve volumes is greater ! than or equal to 1, then option 1 is used. When the 4th argument is left ! blank, option 2 is used. ! ! If the volumes created by this macro are to be used in a boolean ! operation, e.g. as volumes to be removed in a volume subtraction, then ! the volumes are automatically stored in a component group named: ! ! new_vols ! ! This component group name may be substituted in the 'vsbv' operation ! without having to store them in a component group manually. ! ! ! *get,prkey_,active,0,prkey /nopr ! numseg_=arg4 ! *get,alow_,area,,num,min *get,ahigh_,area,,num,max ! *if,numseg_,ge,1,then axp1_=arg1 axp2_=arg2 revang_=arg3 ! *do,iiii_,alow_,ahigh_,1 *if,asel(iiii_),ne,0,then *get,amat_,area,iiii_,attr,mat *get,areal_,area,iiii_,attr,real *get,atyp_,area,iiii_,attr,type *get,aesys_,area,iiii_,attr,esys ! *if,amat_,eq,0,then amat_=attrmat_ aatt,amat_,areal_,atyp_,aesys_ *endif ! vrotat,iiii_,,,,,,axp1_,axp2_,revang_,numseg_ get_max_entity vsel,s,volu,,vm-(numseg_-1),vm,1 vatt,amat_,areal_,atyp_,aesys_ *endif *enddo *else csnum_=arg1 revang_=arg2 numseg_=arg3 ! *get,actcs_,active,,csys ! csys,csnum_ ! *get,cstyp_,cdsy,csnum_,attr,kcs ! *if,cstyp_,ne,0,then create_cs,0,,0,0,0,0,0,0,0 csnum_=csn+1 *endif ! k,,0,0,0 k,,0,0,1 ! get_max_entity ! axp1_=km-1 axp2_=km ! *do,iiii_,alow_,ahigh_,1 *if,asel(iiii_),ne,0,then *get,amat_,area,iiii_,attr,mat *get,areal_,area,iiii_,attr,real *get,atyp_,area,iiii_,attr,type *get,aesys_,area,iiii_,attr,esys ! *if,amat_,eq,0,then amat_=attrmat_ aatt,amat_,areal_,atyp_,aesys_ *endif ! vrotat,iiii_,,,,,,axp1_,axp2_,revang_,numseg_ get_max_entity vsel,s,volu,,vm-(numseg_-1),vm,1 vatt,amat_,areal_,atyp_,aesys_ *endif *enddo ! kdele,axp1_,axp2_,1 ! csys,actcs_ ! *set,csnum_, *set,actcs_, *set,cstyp_, *endif ! init_entity_num ! vsel,s,volu,,vm-(numseg_-1),vm cm,new_vols,volu init_entity_num ! lplot ! *set,iiii_, *set,axp1_, *set,axp2_, *set,revang_, *set,numseg_, *set,alow_, *set,ahigh_, *set,amat_, *set,areal_, *set,atyp_, *set,aesys_, ! *if,prkey_,eq,1,then /go *endif