PyAEDT

repository·main·Indexed 18 days ago

https://github.com/ansys/pyaedt

A high-level Python API for automating Ansys Electronics Desktop (AEDT) and its solvers, including HFSS, Maxwell, Icepak, Q3D Extractor, Mechanical, Nexxim, Twin Builder, and EMIT. It provides robust error management, object initialization, and cross-solver code reusability, supporting both CPython and IronPython. Key features include geometry creation via the modeler, remote application calls via gRPC, and specialized modules for cable modeling in HFSS Beta.

Tokens
96K
Snippets
303
Records
445
Agent score
63%

What's inside pyaedt

  1. Overview of the Result Calculator extension

    main

    The Result Calculator is a PyAEDT extension designed to collect, plot, and manage result traces from one or more AEDT sessions. It provides a GUI for:

    • Importing traces from AEDT reports and datasets.
    • Managing traces from multiple AEDT sessions simultaneously.
    • Performing calculations using mathematical formulas (supporting complex numbers and NumPy functions).
    • Exporting results to CSV, TSV, JSON, NPZ, and TXT formats.
    • Plotting and visualizing data with interactive plots.
    • Loading external data from files like Touchstone (.sNp), CSV, and TSV.
  2. What is PyAEDT?

    main

    PyAEDT is a Python library that provides a simplified API for interacting with Ansys Electronics Desktop (AEDT). It is designed to replace difficult-to-read recorded scripts with clean, PEP8-compliant Python code.

    Key Capabilities:

    • Multi-Product Support: Works with HFSS, Icepak, Maxwell (2D/3D), Q3D Extractor, Mechanical, Nexxim, Twin Builder, and EMIT.
    • Layout Support: Provides scripting for HFSS 3D Layout and includes support for the Ansys Electronics Database (EDB).
    • Automation Features: Automatic initialization of AEDT objects, error/log/variable management, and code reusability across different solvers.
    • Environment Flexibility: Compatible with both CPython and IronPython (allowing use within the AEDT framework).
  3. Available HFSS extensions in PyAEDT

    main

    PyAEDT provides several specialized extension workflows for Ansys HFSS to automate complex design and analysis tasks. These extensions include:

    • Choke designer: Automates the design of a choke and imports the resulting geometry into HFSS.
    • Push excitation from file: Allows editing an HFSS source using data from an external file.
    • Shielding effectiveness: Provides a dedicated workflow for analyzing shielding effectiveness in HFSS.
    • Move it: Generates the parameters required to simulate a trajectory based on a defined line.
    • MCAD Assembly: Automates the assembly workflow for MCAD models.
    • Fresnel: Extracts Fresnel coefficients from HFSS Floquet port simulations, specifically for periodic structures.
  4. Use Maxwell extensions for Fields distribution and Coil design

    main

    PyAEDT provides specialized extensions for Ansys Maxwell to automate complex electromagnetic tasks. These extensions include:

    • Fields distribution: Predict and export electromagnetic fields distribution on a defined grid of points or directly on mesh nodes.
    • Create coil design geometries: Automate the creation of complex coil design geometries based on specific input parameters.

    Refer to the specific documentation for fields_distribution and create_coil to implement these workflows.

  5. HFSS 3D Layout extensions overview

    main

    PyAEDT provides several specialized extensions for working with HFSS 3D Layout. These extensions allow you to automate complex layout tasks such as parameterization, port generation, excitation management, and exporting.

    Available extension workflows include:

    • Parametrize Layout: Automate the parameterization of a full .aedb file.
    • Generate arbitrary wave ports: Programmatically create arbitrary wave ports within HFSS.
    • Push excitation from file: Edit or update HFSS sources using data from external files.
    • Cutout: Perform advanced layout cutout operations.
    • Export layout: Export the layout configuration.
    • Export to 3D: Export the layout into a 3D model format.
  6. Use Circuit extensions in PyAEDT

    main

    PyAEDT provides extensions for working with Circuit designs. These extensions allow you to automate common tasks such as importing existing schematic files and configuring simulation settings.

    Key capabilities include:

    • Importing schematics: Automate the import of various schematic file formats (including .acs, .sp, .cir, and .qcv) into a Circuit design.
    • Circuit configuration: Programmatically apply simulation configurations to your Circuit designs to ensure consistent setup for analysis.
  7. Available Project Extensions in PyAEDT

    main

    PyAEDT provides several project extensions to automate specialized workflows within 3D modeler applications. These extensions include:

    • Import Nastran: Import Nastran or STL files into any 3D modeler.
    • Configure Layout: Set up layouts specifically for PCB and package analysis.
    • Advanced Fields Calculator: Utilize advanced capabilities for field calculations.
    • Kernel Converter: Convert projects from AEDT version 2022R2 to newer versions.
    • Point Cloud Generator: Generate and import point lists derived from geometry.
    • Via Design: Generate parameterized via designs.
    • Result Calculator: Collect, plot, and manage result traces.
  8. Use the Version Manager extension to manage PyAEDT and PyEDB

    main

    The Version Manager is a GUI extension that provides a lightweight panel to view your Python environment and manage the core packages pyaedt and pyedb.

    Key Capabilities:

    • View your virtual environment path and Python version.
    • Compare currently installed versions of pyaedt and pyedb against the latest releases on PyPI.
    • Update or downgrade packages to the latest official PyPI release.
    • Install packages directly from a Git branch.
    • Install pyaedt[all] from a validated wheelhouse ZIP file.
    • Reset PyAEDT buttons within the AEDT interface if they go missing after an update.

    Interface Tabs:

    • Basic Tab: Contains version information, individual package update buttons, an 'Update All' button, and the 'Update from wheelhouse' option.
    • Advanced Tab: Contains fields for Git branch installations and the 'Reset AEDT panels' action.
  9. PyAEDT User Guide Overview

    main

    The PyAEDT User Guide provides tutorials covering the core workflows for automating Ansys Electronics Desktop (AEDT). Key areas of focus include:

    • Project Lifecycle: Launching AEDT, creating projects, and managing input/output files.
    • Geometry & Meshing: Using 2D and 3D Modelers and performing mesh operations.
    • Simulation Control: Configuring setups, running simulations, and managing parametric models/optimizations.
    • Postprocessing: Generating reports, images, and PDF files, and using the Field Expression Builder for typed Fields Calculator expressions.
    • Advanced Control: Using the Desktop class for full application control and utilizing PyAEDT extensions.
    • Specialized Tools: Using the EMIT Modeler for EMIT designs.

    For comprehensive, end-to-end examples, refer to the PyAnsys Examples documentation.

  10. Explore PyAEDT visualization capabilities

    main

    PyAEDT provides four primary levels of visualization for creating and editing data both within and outside of Ansys AEDT:

    1. Reports: Dedicated classes to manipulate all report properties, providing full control over report customization and generation.
    2. Post-processing: Classes to interact with and modify AEDT's built-in post-processing tools for enhanced data analysis.
    3. Graphics: Specialized plotting options (e.g., using Matplotlib or PyVista).
    4. Advanced Visualization: High-level visualization tools for complex data like farfields.
  11. Supported file formats for simulation and setup data

    main

    PyAEDT supports several file formats to manage simulation configurations, geometry, and reporting. The primary file types include:

    • Project files: Used to apply sets of variables, materials, setups, meshes, and boundaries.
    • Report files: Used to create customized AEDT reports.
    • Materials files: Used to import and export materials in AEDT.
    • Primitives files: Used to create primitives from a file.
    • Array files: Used to control 3D Component array geometry.
    • Cables files: Used to control cable design.
    • Choke files: Used to control choke synthesis.