Mapdl Class Specific Classes or Attributes

class ansys.mapdl.core.mapdl._MapdlCore(loglevel='DEBUG', use_vtk=True, log_apdl=None, log_file=False, local=True, **start_parm)

Contains methods in common between all Mapdl subclasses

Mapdl.add_file_handler(filepath[, append, level])

Add a file handler to the mapdl log.


Invalid commands will be ignored rather than exceptions


Chain several mapdl commands.

Current MAPDL directory

Mapdl.get([par, entity, entnum, item1, ...])

Retrieves a value and stores it as a scalar parameter or part of an array parameter.

Mapdl.get_array([entity, entnum, item1, ...])

Uses the *VGET command to Return an array from ANSYS as a Python array.

Mapdl.get_value([entity, entnum, item1, ...])

Runs the MAPDL GET command and returns a Python value.


Flag to ignore MAPDL errors.


MAPDL job name.


Returns the last response from MAPDL.

Mapdl.load_table(name, array[, var1, var2, ...])

Load a table from Python to MAPDL.


Mesh information.

Mapdl.modal_analysis([method, nmode, freqb, ...])

Run a modal with basic settings analysis


Non-interactive context manager.

Mapdl.open_apdl_log(filename[, mode])

Start writing all APDL commands to an MAPDL input file.


Saves existing database and opens up the APDL GUI.


Collection of MAPDL parameters obtainable from the *GET command or GET command.


Binary interface to the result file using pyansys.Result[, write_to_log])

Run single APDL command.


Run several commands as a single block


Sets log level


MAPDL build version

Latest 2021R1 and newer features

class ansys.mapdl.core.mapdl_grpc.MapdlGrpc(ip='', port=None, timeout=15, loglevel='WARNING', log_file=False, cleanup_on_exit=False, log_apdl=None, set_no_abort=True, remove_temp_files=False, **kwargs)

This class connects to a GRPC MAPDL server and allows commands to be passed to a persistent session.

ipstr, optional

IP address to connect to the server. Defaults to ‘localhost’.

portint, optional

Port to connect to the mapdl server. Defaults to 50052.


Maximum allowable time to connect to the MAPDL server.

loglevelstr, optional

Sets which messages are printed to the console. Default ‘INFO’ prints out all ANSYS messages, ‘WARNING` prints only messages containing ANSYS warnings, and ‘ERROR’ prints only error messages.

cleanup_on_exitbool, optional

Exit MAPDL when Python exits or when this instance is garbage collected.

set_no_abortbool, optional

Sets MAPDL to not abort at the first error within /BATCH mode. Default True.

remove_temp_filesbool, optional

Removes temporary files on exit if MAPDL is local. Default False.

log_filebool, optional

Copy the log to a file called logs.log located where the python script is executed. Default True.


Connect to an instance of MAPDL already running on locally on the default port 50052.

>>> from ansys.mapdl import core as pymapdl
>>> mapdl = pymapdl.Mapdl()

Connect to an instance of MAPDL running on the LAN on a default port

>>> mapdl = pymapdl.Mapdl('')

Connect to an instance of MAPDL running on the LAN on a non-default port

>>> mapdl = pymapdl.Mapdl('', port=60001)[, ...])

Download a file from the gRPC instance


Listing of errors written in JOBNAME.err


List the files in the working directory of MAPDL.


APDL math interface


Silence the response from all MAPDL functions unless explicitly set to True.

mapdl_grpc.MapdlGrpc.upload(file_name[, ...])

Upload a file to the grpc instance