Introduction
With this blog, we’re excited to introduce you to PyWorkbench, a powerful new client library that enhances the Ansys Workbench platform for engineering simulations. By providing seamless automation and integration, PyWorkbench streamlines adoption and delivers customer-centric solutions. Experience an environment that harnesses the power of diverse PyAnsys modules for Ansys applications integrated with Workbench. With PyWorkbench client library, you can fully leverage the capabilities of the Ansys Workbench, making it simpler to adopt and use for your specific needs. It connects seamlessly with different PyAnsys modules, allowing you to work with a range of Ansys applications. In this blog post, we will guide you through key concepts and practical strategies for using PyWorkbench. You will learn how to interact with them programmatically, making your engineering simulations more efficient and effective. Let’s dive in! Leverage PyWorkbench to achieve objectives such as:- Improved automation, seamless integration with PyAnsys modules, and enhanced user experience for engineering simulations.
- Streamline your workflows for faster and easier integration.
- Use Python’s flexibility to manage and customize your simulation processes.
Set up your environment
Before you can use PyAnsys libraries, you must set up your environment. First, ensure that you have legally licensed copies of these Ansys products installed: Once these Ansys products are installed, set up your environment:- Install Python (if not already installed).
- Activate the virtual environment.
-
For Windows CMD:
-
For Windows Powershell:
-
For Linux:
From this point forward, you must execute all commands within the virtual environment.
- Install the libraries.
ansys-workbench-core, and ansys-mechanical-core packages:
Note: For beginners who find the preceding steps challenging, consider using the Ansys Python Manager to install Python and PyAnsys metapackages. This tool also simplifies the process of creating and managing virtual environments.
Create Workflow using PyWorkbench
To establish the workflow, it’s necessary to initiate the PyWorkbench server, which can be done using thelaunch_workbench() method. This procedure initiates a Workbench server on the selected machine and constructs a PyWorkbench client that connects to that server. This system is compatible with Python’s interactive mode, enabling real-time script development before executing your code as a program or in batch mode.
run_script_string() or run_script_file() methods. These journaling commands can be utilized to construct the connected system or extract data from the archived system. For instance, the subsequent journal script demonstrates how you can leverage these methods to access the archived system within the Material Designer workflow.


download_project_archive() method, which facilitates the archival and download of the project. Finally, call the exit() method on the Workbench client to gracefully shut down the service.