! ========================================= ! Shen-Yeh Chen ! 05/01/1998 ! ========================================= ! ! This macro will sweep the currently selected or assigedn SHELL elements into ! SOLID elements ! ------------------------------------------ ! Syntax : ! ! x_shl2sld,_ShellET#,_SolidET#,_NodeOffset#,_ElemOffset#,_NElem,_DX,_DY,_DZ ! 1 2 3 4 5 6 7 8 ! Argument ! (1) _ShellET# : The ET# for base shell elements. The macro will perform ! ESEL,,TYPE,,_ShellET# to pick the base shell elements. ! If omitted, the currently selected elements will be used. ! The macro will take the first 4 nodes in the currently ! selected elements as bottom face of the final SOLID, ! no matter it is SHELL or not. ! (2) _SolidET# : ET# of the created SOLID45 elements. The macro use this number ! and issue a ET,_SolidET#,45 command for the created elements. ! If omitted, the maximum ET# plus will be used. ! (3) _NodeOffset# : ID Offset for the created nodes. If omitted, the maximum defined ! ID number will be used. ! (4) _ElemOffset# : ID Offset for the created elements. If omitted, the maximum defined ! ID number will be used. ! (5) _NElem : Layer of SOLID element to be created (repeated). ! (6) _DX,_DY,_DZ : Offset of the coordinates for ONE layer of solid elemnt ! in the active coordinate systems ! ! ! Notes ! (1) Note that when the elements are swept 360 degree, the nodes on the coinsident ! SOLID faces (the final 360 degree) are not merged. The user can ! use the NUMMRG,NODE command to merge these nodes ! (2) The orientation of the final SOLID IS checked. The macro first create one ! layer of SOLID elements, and make sure the orientation of all elements in this layer ! are correct, then NGEN and EGEN are used to gerenate the rest of the elements ! ! ! External programs called : ! None ! ========================================= /PREP7 *IF,ARG1,NE,0,THEN esel,,type,,ARG1 *ENDIF nsle cm,ztmp0000,node *GET,ZE,ELEM,,NUM,MAX ! ZTYPE=ARG2 ZNOFF=ARG3 ZEOFF=ARG4 *IF,ARG2,EQ,0,THEN *GET,ZTYPE,ETYP,,NUM,MAX ZTYPE=ZTYPE+1 *ENDIF *IF,ARG3,EQ,0,THEN CM,ZTMP0001,NODE NALL *GET,ZNOFF,NODE,,NUM,MAX CMSEL,,ZTMP0001 *ENDIF *IF,ARG4,EQ,0,THEN CM,ZTMP0001,ELEM EALL *GET,ZEOFF,ELEM,,NUM,MAX CMSEL,,ZTMP0001 *ENDIF et,ZTYPE,45 ! !*DIM,ZEL,,ZE *DIM,Z1,,ZE *DIM,Z2,,ZE *DIM,Z3,,ZE *DIM,Z4,,ZE *DIM,Z5,,ZE *DIM,Z6,,ZE *DIM,Z7,,ZE *DIM,Z8,,ZE *DIM,ZES,,ZE *DIM,ZV1,,3 *DIM,ZV2,,3 *DIM,ZV3,,3 *DIM,ZV4,,3 ! ! ! GET SELECTED ELEMENTS AND FILL IN ELEMENT NUMBER *VGET,ZES(1),ELEM,1,ESEL !*VFILL,ZEL(1),RAMP,1,1 ! ! GET ALL ELEMENTS NODES *VMASK,ZES(1) *VGET,Z1(1),ELEM,1,NODE,1 *VMASK,ZES(1) *VGET,Z2(1),ELEM,1,NODE,2 *VMASK,ZES(1) *VGET,Z3(1),ELEM,1,NODE,3 *VMASK,ZES(1) *VGET,Z4(1),ELEM,1,NODE,4 *VMASK,ZES(1) *VOPER,Z5(1),Z1(1),ADD,ZNOFF, *VMASK,ZES(1) *VOPER,Z6(1),Z2(1),ADD,ZNOFF, *VMASK,ZES(1) *VOPER,Z7(1),Z3(1),ADD,ZNOFF, *VMASK,ZES(1) *VOPER,Z8(1),Z4(1),ADD,ZNOFF, ! ! ! NGEN,2,ZNOFF,ALL,,,ARG6,ARG7,ARG8 ! ! CM,ZTMP0001,NODE CM,ZTMP0002,ELEM type,ZTYPE *VMASK,ZES(1) e,z1(1:ZE),z2(1:ZE),z3(1:ZE),z4(1:ZE),z5(1:ZE),z6(1:ZE),z7(1:ZE),z8(1:ZE) ! ! ! ! pick the newly created elements only CMSEL,U,ZTMP0002 CM,ZTMP0003,ELEM ! ! ! check and re-number the first layer of SOLID element *GET,AR21,ELEM,,NUM,MIN *GET,AR22,ELEM,,NUM,MAX *DO,ZI,AR21,AR22 *GET,AR23,ELEM,ZI,ESEL *IF,AR23,NE,0,THEN *GET,ZN1,ELEM,ZI,NODE,1 *GET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