Skip to content

ansys/pymechanical

PyMechanical logo

PyAnsys PyPI Python GH-CI Codecov MIT Ruff pre-commit Ask DeepWiki

Overview

PyMechanical is a Python interface for Ansys Mechanical, enabling automation and integration of complex simulation analysis workflows. It supports both remote sessions and embedded instances.

Installation

Install from PyPI:

pip install ansys-mechanical-core

Requirements:

  • Licensed copy of Ansys Mechanical (2024 R1+ on Windows/Linux)
  • For embedded instances: Local Mechanical installation required
  • For remote sessions: Network access to a running Mechanical instance
  • Python 3.10 - 3.13

Quick start

Remote session:

import ansys.mechanical.core as pymechanical

mechanical = pymechanical.launch_mechanical()
result = mechanical.run_python_script("2+3")

Embedded instance: .. code:: python

import ansys.mechanical.core as pymechanical

app = pymechanical.App() app.update_globals(globals()) print(DataModel.Project.ProjectDirectory)

Documentation and support

About

Pythonic interface to Ansys Mechanical ™

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 23