! TITLE: create_circle.mac (SM_TOOL) ! ! ! OBJECTIVE: ! ! This sub-macro creates a set of circular profile lines. ! ! ! COMMAND SYNTAX: ! ! (1) (2) (3) (4) (5) ! CREATE_CIRCLE, radius, z_loc, ang_inc, n_arc, st_ang ! ! ! ARGUMENTS: ! ! (1) radius = the radius of the circle ! ! (2) z_loc = the location of the circle center along the z-axis ! of the active coordinate system ! ! (3) ang_inc = angle subtended by arc(s). When specifying this ! parameter, the algorithm will create the circle ! with a series of arcs subtending an angle of ! 'ANG_INC'. Therefore, the value of this parameter ! must be an integral divisor of 360; i.e., 3,4,5,6, ! 8,9,10,12,....180. When this parameter is desired, ! 'N_ARC' must be left blank. ! ! (4) n_arc = The number of equal arc increments that the circle ! is constructed from. If this argument is specified, ! then 'ANG_INC' is over-ridden and the circle is ! created by this number of equal arcs. ! ! (5) st_ang = The start angle of the first arc used in the ! construction of the circle. ! ! ! DESCRIPTION: ! ! It may be used to create a full circle or a partial circle of arcs. The ! circle or arcs may be created with various arc angle increments or number ! of arcs within given start and finish angles. ! ! When arguments 2, 3 and 4 are left blank, the algorithm defaults to a ! circle of 4 90 degree arcs starting at the X-axis (0 degrees). ! ! ! ! *get,prkey_,active,0,prkey /nopr ! rad_=arg1 zloc_=arg2 anginc_=arg3 narc_=arg4 stang_=arg5 ! *get,ccs_,active,,csys ! *get,ccstyp_,cdsy,ccs_,attr,kcs ! *if,ccstyp_,ne,1,then clocal,csn+50,1,0,0,0,0,0,0 *endif ! finang_=stang_+360 ! *if,narc_,eq,0,then *if,anginc_,eq,0,then anginc_=90 narc_=4 *else narc_=abs(finang_-stang_)/anginc_ *endif *else anginc_=abs(finang_-stang_)/narc_ *endif ! *do,ii_,0,narc_-1,1 ang_=stang_+(ii_*anginc_) k,,rad_,ang_,zloc_ *enddo ! create_lines,1 ! *if,anginc_,eq,180,or,narc_,eq,2,then lsel,r,line,,lm clocal,csn+51,0,0,0,0,0,0,0 lsymm,y,lm get_max_entity lglue,lm-1,lm csdele,csn+51 *endif ! *if,ccstyp_,ne,1,then csdele,csn+50 *endif ! csys,ccs_ ! ! *set,ii_ *set,rad_ *set,stang_ *set,finang_ *set,anginc_ *set,narc_ *set,ccs_ *set,ccstyp_ *set,ang_ *set,zloc_ ! *if,prkey_,eq,1,then /go *endif