Professional Documents
Culture Documents
Macro Basics
Training Manual
...Macro Basics
Training Manual
A. Creating a Macro
F. Workshop
Macro Basics
A. Creating a Macro
Training Manual
Macro Basics
...Creating a Macro
Training Manual
Example:
Macro Basics
...Creating a Macro
Training Manual
Search Path:
Macro Basics
Training Manual
Macro Basics
Training Manual
TOTVOLUME, TYPE
Macro Basics
Training Manual
Notes:
Macro Basics
C. Branching
Training Manual
*IF,A,EQ,B,AND,C,GT,D,THEN
Branching begins with *IF and ends with *ENDIF. *ELSEIF and
*ELSE are also allowed in between:
*if, x, eq, y, then
*else
*endif
Macro Basics
...Branching
Training Manual
!x=y
x, NE, y
!xy
x, LT, y
!x<y
x, GT, y
to execute the
subsequent block of
commands
!x>y
*EXIT
to exit a do-loop
x, LE, y
!xy
x, GE, y
!xy
x, ABLT, y
x, ABGT, y
Macro Basics
...Branching
Training Manual
*if,arg1,lt,1,then
! If arg1 < 1
*msg,warn
! Issue a warning...
Element type number must be 1 or greater
/eof
! and exit the macro
*endif
esel,s,type,,arg1
! Select elements of specified type
etable,volume,volu
! Store volume in element table
ssum
! Sum element table items
...
Macro Basics
D. Looping
Training Manual
Macro Basics
...Looping
Training Manual
Macro Basics
E. General Guidelines
Training Manual
As you create the macro, remember that you can cut and
paste the commands into the ANSYS Input window to test
and make sure that the command sequence is correct.
Use comments to describe the intent or expected outcome of
commands.
Macro Basics
F. Workshop
Training Manual