higher-level ANSYS Electronics Destkop framework
Project description
Introduction
PyAEDT is intended to consolidate and extend all existing functionalities around AEDT-based scripting to allow re-use of existing code, sharing of best-practice and increase collaboration collaboration. PyAEDT is licensed under the MIT License
This tool includes functionality to interact with HFSS, Icepak, Maxwell 3D, and Q3D.
What is PyAEDT
PyAEDT is an Python library which interacts directly with the AEDT API to make scripting simpler for the end user. It uses an architecture that can be reused for all 3D tools (Maxwell, Q3D, HFSS, Icepak), and in future for all other desktop tools. Its classes and methods structures simplifies operation for end-user while reusing as much as possible of the information across the API.
Why PyAEDT
Recording and reusing script is a quick and easy approach for automating simple operations in Desktop UI. However:
Code recorded is dirty and difficult to read and understand.
Difficult to reuse and adapt recorded scripts.
Complex Coding is a need for many global users of AEDT.
Main advantages of PyAEDT are:
Automatic initialization of all the AEDT Objects (e.g. desktop objects like editor, boundaries, etc.)
Error Management
Log management
Variable Management
Compatibility with IronPython and CPython.
Simplification of complex API syntax using to Data Objects while maintaining PEP8 compliance.
Code reusability across different solvers.
Clear documentation on functions and API.
Unit Test of code to increase quality across different AEDT versions.
Example Workflow
Initialize the Desktop class with the version of AEDT to use.
Initialize the application to use within AEDT.
Connect to Desktop from Python IDE
Work inside Electronics Desktop and as a standalone application. Detects automatically if running in an IronPython or CPython environment and initializes Desktop accordingly. Also provides advanced error management. Examples of usage:
Explicit Desktop declaration and error management
AEDT 2020R1 in Non-Graphical mode will be launched
from pyaedt. import Desktop, Circuit
with Desktop("2020.1", NG=True):
circuit = Circuit()
...
# Any error here will be caught by Desktop...
...
# Desktop is automatically released here
Implicit Desktop Declaration and error management
Launch the latest version of Desktop in Graphical mode
from pyaedt import Circuit
with Circuit as circuit:
...
# Any error here will be caught by Desktop...
...
# Desktop is automatically released here
Variables
from pyaedt.HFSS import HFSS
with HFSS as hfss:
hfss["dim"] = "1mm" # design variable
hfss["$dim"] = "1mm" # project variable
Modeler
Create a box, assign variables, and assign materials.
from pyaedt.HFSS import HFSS
with HFSS as hfss:
hfss.modeler.primitives.create_box([0, 0, 0], [10, "dim", 10],
"mybox", "aluminum")
License
PyAEDT is licensed under the MIT license.
This module, pyaedt makes no commercial claim over Ansys whatsoever. This tool extends the functionality of AEDT by adding an additioanl Python interface to the AEDT without changing the core behavior or license of the original software. The use of the interactive APDL control of PyAEDT requires a legally licensed local copy of Ansys.
To get a copy of Ansys, please visit Ansys.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.