! TITLE: v_sub_a.mac (SM_TOOL) ! ! ! OBJECTIVE: ! ! This sub-macro executes the booleam operation: volume-subtract-area. ! ! ! COMMAND SYNTAX: ! ! (1) (2) (3) (4) (5) ! V_SUB_A, V1, A1, sepo, keep_v1, keep_a1 ! ! ! ARGUMENTS: ! ! (1) V1 = volume(s) to subtract/partition areas from. ! (if a component group name is used, it must be entered ! in single quotes) ! ! (2) A1 = area(s) to subtract. ! (if a component group name is used, it must be entered ! in single quotes) ! ! (3) sepo = behavior at the boundary of partitioned volumes: ! ! 0 (or blank) = volumes will share their common areas ! where they touch. (DEFAULT) ! ! 1 = volumes will have separate, but coincident, ! areas where they touch. ! ! (4) keep_V1 = boolean to determine whether to keep/delete volume(s) ! V1. ! ! 0 (or blank) = delete the original volume(s), V1, after the ! subtraction operation. (DEFAULT) ! ! 1 = keep the original volume(s), V1, after the subtraction ! operation. ! ! (5) keep_A1 = boolean to determine whether to keep/delete area(s) A1 ! ! 0 (or blank) = delete the original area(s), A1, after the ! subtraction operation. (DEFAULT) ! ! 1 = keep the original area(s), A1, after the subtraction ! operation. ! ! ! DESCRIPTION: ! ! This macro executes the VSBA command in ANSYS. Its argument structure is ! identical in use and sequence as VSBA, but has more common default uses, ! and uses boolean inputs (0 or 1) in place of the VSBV command character ! inputs of arguments 3, 4 and 5: 'sepo', 'keep' and 'delete'. (See VSBA ! help for oomparison) ! ! It is a short-hand version that alleviates the common use of arguments 3, 4 ! and 5. The defaults of these arguments in this macro that are commonly used: ! ! "Delete the original volumes and share their common areas where ! they intersect." (vsba,V1,A1,,delete,delete) ! ! The other options for these arguments may be excercised by simple boolean ! selections of 0 or 1. ! ! The added advantage and rationale for this macro command is the automatic ! update of the solid model entities maximums (INIT_ENTITY_NUM is used ! internally), thereby eliminating essentially 2 lines of code with the use ! of 1. Therefore the lines of code: ! ! vsba,V1,A1,,delete,delete ! init_entity_num ! aplot ! ! may be replaced with the single line of this macro: ! ! v_sub_a,V1,A1 ! ! ! *get,prkey_,active,0,prkey /nopr ! v1__=arg1 a1__=arg2 sep__=arg3 keepv1__=arg4 keepa1__=arg5 ! *if,sep__,eq,1,then sep__='sepo' *endif ! *if,keepv1__,eq,0,then keepv1__='delete' *elseif,keepv1__,eq,1,then keepv1__='keep' *endif ! *if,keepa1__,eq,0,then keepa1__='delete' *elseif,keepa1__,eq,1,then keepa1__='keep' *endif ! vsba,v1__,a1__,sep__,keepv1__,keepa1__ init_entity_num ! aplot ! *set,v1__, *set,a1__, *set,sep__, *set,keepv1__, *set,keepa1__, ! *if,prkey_,eq,1,then /go *endif