Skip to main content

Higher-Level Pythonic Ansys Electronics Destkop Framework

Project description

Introduction

PyAEDT is intended to consolidate and extend all existing functionalities around scripting for Ansys Electronics Desktop (AEDT) to allow reuse of existing code, sharing of best practices, and increased collaboration. PyAEDT is licensed under the MIT License.

PyAEDT includes functionality for interacting with the following AEDT tools and Ansys products:

  • HFSS and HFSS 3D Layout

  • Icepak

  • Maxwell 2D/3D and RMxprt

  • Q3D/2DExtractor

  • Mechanical

  • Nexxim

  • Simplorer

  • EDB Database

What is PyAEDT?

PyAEDT is a Python library that interacts directly with the AEDT API to make scripting simpler for the end user. It uses an architecture that can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D, Q3D and Mechanical) as well as 2D tools and circuit tools like Nexxim and Simplorer. Finally it provides scripting capabilities in Ansys layout tools like HFSS 3D Layout and EDB. Its class and method structures simplify operation for the end user while reusing information as much as possible across the API.

Documentation and Issues

See the API Documentation and explore the Examples.

To post issues, questions, and code, go to PyAEDT Issues.

Project Transition - Legacy Support

This project was formerly known as AEDTLib. Thanks to all early adopters, contributors, and users who submitted issues, gave feedback, and contributed code through the years.

With PyAEDT, Ansys is leveraging its ability to create new Pythonic, cross-platform, and multi-language service-based interfaces for Ansys products. Your contributions to PyAEDT will help shape PyAEDT into a better solution.

Dependencies

To run PyAEDT, you must have a local licenced copy of AEDT. PyAEDT supports AEDT versions prior to and including 2021 R2.

Student Version

PyAEDT now supports supports also AEDT Student version 2021 R2. Visit Student Version page for more info.

Why PyAEDT?

A quick and easy approach for automating a simple operation in the AEDT UI is to record and reuse a scripts. However, disadvantages of this approach are:

  • Recorded code is dirty and difficult to read and understand.

  • Recorded scripts are difficult to reuse and adapt.

  • Complex coding is required by many global users of AEDT.

The main advantages of PyAEDT are:

  • Automatic initialization of all AEDT objects, such as desktop objects like the editor, boundaries, and so on

  • Error management

  • Log management

  • Variable management

  • Compatibility with IronPython and CPython

  • Simplification of complex API syntax using data objects while maintaining PEP8 compliance.

  • Code reusability across different solvers

  • Clear documentation on functions and API

  • Unit tests of code to increase quality across different AEDT versions

Example Workflow

  1. Initialize the Desktop class with the version of AEDT to use.

  2. Initialize the application to use within AEDT.

Connect to Desktop from Python IDE

PyAEDT works both inside AEDT and as a standalone application. It automatically detects whether it is running in an IronPython or CPython environment and initializes the Desktop accordingly. PyAEDT also provides advanced error management. Usage examples follow.

Explicit Desktop Declaration and Error Management

Launch AEDT 2021 R1 in Non-Graphical mode

from pyaedt import Desktop, Circuit
with Desktop(specified_version="2021.1",
             non_graphical=False, new_desktop_session=True,
             close_on_exit=True, student_version=False):
    circuit = Circuit()
    ...
    # Any error here will be caught by Desktop.
    ...

# Desktop is automatically released here.

Implicit Desktop Declaration and Error Management

Launch the latest installed version of AEDT in graphical mode

from pyaedt import Circuit
with Circuit(specified_version="2021.2",
             non_graphical=False) 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 PyAEDT module makes no commercial claim over Ansys whatsoever. PyAEDT extends the functionality of AEDT by adding an additional Python interface to 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 AEDT. For more information about AEDT, visit the AEDT page on the Ansys website.

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.

Source Distribution

pyaedt-0.3.25.tar.gz (1.5 MB view details)

Uploaded Source

File details

Details for the file pyaedt-0.3.25.tar.gz.

File metadata

  • Download URL: pyaedt-0.3.25.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pyaedt-0.3.25.tar.gz
Algorithm Hash digest
SHA256 6923dff41a8a2fd32d102c466d49a3000b2385ba0ff93ef565f9c6672cc74420
MD5 f47e43372d9c1b5646c83b8e42b787be
BLAKE2b-256 ece058568a5d0da068716160212b7e5fb3e4a5e33f07c3481d23f7b481d187bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page