Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,31 @@ 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.


Compatibility
~~~~~~~~~~~~~

**Supported versions:**

* **Python**: 3.10 - 3.13
* **Mechanical**: 2024 R1 (v241) to 2025 R2 (v252)
* **Platforms**: Windows, Linux

Installation
------------

Install from PyPI::

pip install ansys-mechanical-core

For graphics support::

pip install ansys-mechanical-core[graphics]

For RPC functionality::

pip install ansys-mechanical-core[rpc]

**Requirements:**

* Licensed copy of `Ansys Mechanical <https://www.ansys.com/products/structures/ansys-mechanical>`_ (2024 R1+ on Windows/Linux)
Expand All @@ -70,19 +88,52 @@ Quick start

import ansys.mechanical.core as pymechanical

# Launch a new Mechanical instance
mechanical = pymechanical.launch_mechanical()
result = mechanical.run_python_script("2+3")
print(result) # Output: 5
mechanical.exit()

**Connect to existing instance:**

.. code:: python

import ansys.mechanical.core as pymechanical

# Connect to a running instance on port 10000
mechanical = pymechanical.connect_to_mechanical(port=10000)
result = mechanical.run_python_script("Model.Name")
print(result)

**Embedded instance:**

.. code:: python

import ansys.mechanical.core as pymechanical

# Create an embedded Mechanical app
app = pymechanical.App()
app.update_globals(globals())

# Access Mechanical objects directly
print(DataModel.Project.ProjectDirectory)

# Add analysis and solve
model = Model
static = model.AddStaticStructuralAnalysis()
static.Solution.Solve(True)


Troubleshooting
---------------

**Common issues:**

* **Connection refused**: Ensure Mechanical is running and the port is accessible
* **License error**: Verify your Ansys license is properly configured
* **Import error**: Check that ``ansys-pythonnet`` is installed (not ``pythonnet``)
* **Linux embedding**: Use `mechanical-env` to run python scripts for embedded mode.

Documentation and support
-------------------------

Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1501.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add more information in readme
Loading