run#

Mapdl.run(command, write_to_log=True, mute=None, **kwargs)[source]#

Run single APDL command.

For multiple commands, use Mapdl.input_strings().

Parameters:
commandstr

ANSYS APDL command.

write_to_logbool, optional

Overrides APDL log writing. Default True. When set to False, will not write command to log, even if APDL command logging is enabled.

kwargsdict, optional

These keyword arguments are interface specific or for development purposes.

avoid_non_interactivebool

(Development use only) Avoids the non-interactive mode for this specific command. Defaults to False.

verbosebool

Prints the command to the screen before running it. Defaults to False.

Returns:
str

Command output from MAPDL.

Return type:

str

Notes

Running non-interactive commands

When two or more commands need to be run non-interactively (i.e. *VWRITE) use

>>> with mapdl.non_interactive:
...     mapdl.run("*VWRITE,LABEL(1),VALUE(1,1),VALUE(1,2),VALUE(1,3)")
...     mapdl.run("(1X,A8,'   ',F10.1,'  ',F10.1,'   ',1F5.3)")

Alternatively, you can simply run a block of commands with:

>>> mapdl.input_strings(cmd)

Examples

>>> mapdl.run('/PREP7')

Equivalent Pythonic method:

>>> mapdl.prep7()