The table below describes APDL commands that perform control functions within macros.
Most of the important information about these commands appears here, but you may want to look at the complete command descriptions in the Command Reference.
| APDL Command | Action It Takes | Usage Tips |
|---|---|---|
| *DO | Defines the start of a "do" loop. The commands following the *DO command execute (up to the *ENDDO command) repeatedly until some loop control is satisfied. |
|
| *ENDDO | Ends a "do" loop and starts the looping action. | You must use one *ENDDO command for each nested "do" loop. The *ENDDO and *DO commands for a loop must be on the same file. |
| *CYCLE | When executing a "do" loop, Mechanical APDL bypasses all commands between the *CYCLE and *ENDDO commands, then (if applicable) initiates the next loop. | You can use the cycle option conditionally (via the *IF command). The *CYCLE command must appear on the same file as the *DO command and must appear before the *ENDDO command. |
| *EXIT | Exits from a "do" loop. | The command following the *ENDDO command executes next. The *EXIT and *DO commands for a loop must be on the same file. You can use the exit option conditionally (via the *IF command). |
| *IF | Causes commands to be read conditionally. |
|
| *ENDIF | Terminates an if-then-else construct. (See the *IF discussion for details.) | The *IF and *ENDIF commands must appear in the same file. |
| *ELSE | Creates a final, optional block separator within an if-then-else construct. (See the *IF discussion for details.) | The *ELSE and *IF commands must appear in the same file. |
| *ELSEIF | Creates an optional, intermediate block separator within an if-then-else construct. | If Oper = EQ or NE,
VAL1 and VAL2
can also be character strings (enclosed in quotes) or parameters. The
*IF and *ELSEIF commands must
be on the same file. |