! TITLE: v_rect_pattern.mac (SM_TOOL) ! ! ! OBJECTIVE: ! ! This sub-macro creates a rectangular spaced pattern of an volume. ! ! ! COMMAND SYNTAX: ! ! (1) (2) (3) (4) (5) (6) ! V_RECT_PATTERN, acs, vol_#, x_space, N_x, y_space, N_y ! ! ! ARGUMENTS: ! ! (1) acs = the active coordinate system (CS) to build the pattern in. ! May be any CS type (i.e., crtesian, cylindrical, etc.) ! ! (2) vol_# = the volume number to create the pattern from. ! ! (3) x_space = the distance between the volumes along the X-axis ! direction (centroid-to-centroid). ! ! (4) N_x = the number of volumes in the X direction. ! ! (5) y_space = the distance between the volumes along the Y-axis ! direction (centroid-to-centroid). ! ! (6) N_y = the number of volumes in the Y direction. ! ! ! DESCRIPTION: ! ! The rectangular pattern is a planar pattern of volumes that are arranged in ! aligned rows and columns. The number or rows and colums of the pattern are ! determined by arguments 6 and 4, respectively. A row is a series of aligned ! volumes having the same Y coordinate value, whereas a column is a series of ! aligned volumes having the same X coordinate value. ! ! The spacing between each volume, as measured from centroid to centroid, or ! between corresponding identical points or edges on each volume. The spacing ! in the X and Y directions is determined by arguments 3 and 4, respectively. ! ! The new volumes formed from the original volume of argument 2, will be ! patterned along the coordinate X and Y directions of the CS specified in ! argument 1. The CS may be any type (i.e., cartesian, cylindrical, etc.). ! The rectangular pattern will be formed relative to the X and Y axis ! directions of that CS, with the X and Y coordinate values as cartesian ! coordinates. ! ! The newly created volumes are automatically stored in a component group ! designated: ! NEW_VOLS ! ! These volumes may then be manipulated with boolean operations as desired. ! ! To view a rectangle created from this macro, run the following example ! lines of code (must execute 'mod_assemb_prep' prior to running): ! ! EXAMPLE: (place this code in a test macro and execute): ! ! mod_assemb_prep ! create_circ_area,0.500 ! annulus_area,1.000,1.500 ! extrude_aset,-3,1 ! extrude_aset,-1,4 ! v_add,vm-1,vm ! v_rect_pattern,0,vm,3,3,2,2 ! ! ! *get,prkey_,active,0,prkey /nopr ! acs___=arg1 vnum__=arg2 xspace_=arg3 xnum_=arg4 yspace_=arg5 ynum_=arg6 ! csys,acs___ clocal,csn+1000,0,0,0,0,0,0,0 ! ypos_=-yspace_ ! *do,row_,1,ynum_,1 ypos_=ypos_+yspace_ ! csys,csn+1000 ! *if,row_,eq,1,then colinit_=2 clocal,csn+1001,0,0,ypos_,0,0,0,0 *elseif,row_,gt,1,then colinit_=1 clocal,csn+1001,0,-xspace_,ypos_,0,0,0,0 *endif ! *do,col_,colinit_,xnum_,1 clocal,csn+1001,0,xspace_,0,0,0,0,0 ! csys,csn+1000 vtran,csn+1001,vnum__ csys,csn+1001 *enddo *enddo ! init_entity_num ! csdele,csn+1000,csn+1001 ! vsel,s,volu,,vm-((xnum_*ynum_)-1),vm cm,new_vols,volu ! init_entity_num aplot ! *set,acs___, *set,vnum__, *set,xspace_, *set,xnum_, *set,yspace_, *set,ynum_, *set,ypos_, *set,row_, *set,col_, *set,colinit_, ! *if,prkey_,eq,1,then /go *endif