run_as_routine#

Mapdl.run_as_routine(routine)#

Runs a command or commands at a routine and then revert to the prior routine.

This can be useful to avoid constantly changing between routines.

Parameters:
routinestr

A MAPDL routine. For example, "PREP7" or "POST1".

Examples

Enter PREP7 and run numvar, which requires POST26, and revert to the prior routine.

>>> mapdl.prep7()
>>> mapdl.parameters.routine
'PREP7'
>>> with mapdl.run_as_routine('POST26'):
...     mapdl.numvar(200)
>>> mapdl.parameters.routine
'PREP7'