resolve_command_block#

ansys.mapdl.core.cli.exec.resolve_command_block(input_arg=None, commands=(), script_file=None)#

Build the APDL command block from the available command sources.

Parameters:
input_argstr, optional

Inline APDL commands, or "-" to read the commands from stdin.

commandssequence of str, default: ()

APDL commands to join with newlines.

script_filestr, optional

Path to an APDL script file.

Returns:
str

The APDL commands to send to MAPDL.

Raises:
ValueError

When no source or more than one source is given, or when the resulting block is empty.

Return type:

str

Examples

>>> from ansys.mapdl.core.cli.exec import resolve_command_block
>>> resolve_command_block(commands=["/prep7", "SAVE"])
'/prep7\nSAVE'