run

Mapdl.run(command, write_to_log=True, **kwargs)

Run single APDL command.

For multiple commands, use run_multiline.

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.

kwargsOptional keyword arguments

These keyword arguments are interface specific.

Returns
str

Command output from MAPDL.

Notes

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.run_multiline(cmd)

Examples

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

Equivalent Pythonic method:

>>> mapdl.prep7()