Macro files#

These APDL commands are used to build and execute command macros.

Note

Most of the commands here should be replaced with Python alternatives. For example, instead of using macros, use Python functions. Instead of /MKDIR use os.mkdir.

Warning

Many of the commands here must be run in mapdl.non_interactive

Mapdl.cfclos(**kwargs)

Closes the "command" file.

Mapdl.cfopen([fname, ext, loc])

Opens a "command" file.

Mapdl.cfwrite([command])

Writes an ANSYS command (or similar string) to a "command" file.

Mapdl.create([fname, ext])

Opens (creates) a macro file.

Mapdl.dflab([dof, displab, forcelab])

Changes degree-of-freedom labels for user custom elements.

Mapdl.end(**kwargs)

Closes a macro file.

Mapdl.mkdir([dir_])

Creates a directory.

Mapdl.msg([lab, val1, val2, val3, val4, ...])

Writes an output message via the ANSYS message subroutine.

Mapdl.pmacro(**kwargs)

Specifies that macro contents be written to the session log file.

Mapdl.psearch([pname])

Specifies a directory to be searched for "unknown command" macro files.

Mapdl.rmdir([dir_])

Removes (deletes) a directory.

Mapdl.tee([label, fname, ext])

Writes a list of commands to a specified file at the same time that the

Mapdl.ulib([fname, ext])

Identifies a macro library file.

Mapdl.use([name, arg1, arg2, arg3, arg4, ...])

Executes a macro file.