input_strings#

Mapdl.input_strings(commands)[source]#

Run several commands as a single block.

These commands are all in a single string or in list of strings.

Parameters:
commandsstr or list of str

Commands separated by new lines, or a list of commands strings. See example.

Returns:
str

Command output from MAPDL. Includes the output from running every command, as if it was an input file.

Return type:

str

Examples

Run several commands from Python multi-line string.

>>> cmd = '''/prep7
! Mat
MP,EX,1,200000
MP,NUXY,1,0.3
MP,DENS,1,7.85e-09
! Elements
et,1,186
et,2,154
! Geometry
BLC4,0,0,1000,100,10
! Mesh
esize,5
vmesh,all
'''
>>> resp = mapdl.input_strings(cmd)
>>> resp
MATERIAL          1     EX   =   200000.0
MATERIAL          1     NUXY =  0.3000000
MATERIAL          1     DENS =  0.7850000E-08
ELEMENT TYPE          1 IS SOLID186     3-D 20-NODE STRUCTURAL SOLID
 KEYOPT( 1- 6)=        0      0      0        0      0      0
 KEYOPT( 7-12)=        0      0      0        0      0      0
 KEYOPT(13-18)=        0      0      0        0      0      0