Package: pyaedt
PyAEDTEnglish |中文What is PyAEDT?PyAEDT is a Python library that interacts directly with the API for
Ansys Electronics Desktop (AEDT) to make scripting simpler. The architecture
for PyAEDT can be reused for all AEDT 3D products (HFSS, Icepak, Maxwell 3D,
and Q3D Extractor), 2D tools, and Ansys Mechanical. PyAEDT also provides
support for circuit tools like Nexxim and system simulation tools like
Twin Builder. Finally, PyAEDT provides scripting capabilities in Ansys layout
tools like HFSS 3D Layout and EDB. The PyAEDT class and method structures
simplify operation while reusing information as much as possible across
the API.Install on CPython from PyPIYou can install PyAEDT on CPython 3.7 through 3.10 from PyPI with this command:pipinstallpyaedtInstall PyAEDT with all extra packages (matplotlib, numpy, pandas, pyvista):pipinstallpyaedt[full]You can also install PyAEDT from Conda-Forge with this command:condainstall-cconda-forgepyaedtPyAEDT remains compatible with IronPython and can be still used in the AEDT Framework.About PyAnsysPyAEDT is part of the largerPyAnsyseffort to facilitate the use of Ansys technologies directly from Python.PyAEDT is intended to consolidate and extend all existing
functionalities around scripting for AEDT to allow reuse of existing code,
sharing of best practices, and increased collaboration.About AEDTAEDTis a platform that enables true
electronics system design. AEDT provides access to the Ansys gold-standard
electro-magnetics simulation solutions, such as Ansys HFSS, Ansys Maxwell,
Ansys Q3D Extractor, Ansys Siwave, and Ansys Icepak using electrical CAD (ECAD) and
Mechanical CAD (MCAD) workflows.In addition, AEDT includes direct links to the complete Ansys portfolio of thermal, fluid,
and mechanical solvers for comprehensive multiphysics analysis.
Tight integration among these solutions provides unprecedented ease of use for setup and
faster resolution of complex simulations for design and optimization.PyAEDTis licensed under theMIT LicensePyAEDT includes functionality for interacting with the following AEDT tools and Ansys products:HFSS and HFSS 3D LayoutIcepakMaxwell 2D, Maxwell 3D, and RMXprt2D Extractor and Q3D ExtractorMechanicalNexximEDBTwin BuilderEMITDocumentation and issuesDocumentation for the latest stable release of PyAEDT is hosted atPyAEDT documentation.In the upper right corner of the documentation's title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.You can also view or download PyAEDT cheat sheets, which are one-page references
providing syntax rules and commands for using the PyAEDT API and PyEDB API:Viewordownloadthe
PyAEDT API cheat sheet.Viewordownloadthe
PyEDB API cheat sheet.On thePyAEDT Issuespage, you can
create issues to report bugs and request new features. On thePyAEDT Discussionspage or theDiscussionspage on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.DependenciesTo run PyAEDT, you must have a local licenced copy of AEDT.
PyAEDT supports AEDT versions 2022 R1 or newer.Student versionPyAEDT supports AEDT Student versions 2022 R1 and later. For more information, see theAnsys Electronics Desktop Student - Free Software Downloadpage on the Ansys website.Why PyAEDT?A quick and easy approach for automating a simple operation in the AEDT UI is to record and reuse a script. 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 and boundariesError managementLog managementVariable managementCompatibility with IronPython and CPythonSimplification of complex API syntax using data objects while maintaining PEP8 compliance.Code reusability across different solversClear documentation on functions and APIUnit tests of code to increase quality across different AEDT versionsExample workflowInitialize theDesktopclass with the version of AEDT to use.Initialize the application to use within AEDT.Connect to AEDT from Python IDEPyAEDT works both inside AEDT and as a standalone application. This Python library
automatically detects whether it is running in an IronPython or CPython environment
and initializes AEDT accordingly. PyAEDT also provides advanced error management.
Usage examples follow.Explicit AEDT declaration and error management# Launch AEDT 2022 R2 in non-graphical modefrompyaedtimportDesktop,CircuitwithDesktop(specified_version="2022.2",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 AEDT declaration and error management# Launch the latest installed version of AEDT in graphical modefrompyaedtimportCircuitwithCircuit(specified_version="2022.2",non_graphical=False)ascircuit:...# Any error here will be caught by Desktop....# Desktop is automatically released here.Remote application callYou can make a remote application call on a CPython server
or any Windows client machine.On a CPython Server:# Launch PyAEDT remote server on CPythonfrompyaedt.common_rpcimportpyaedt_service_managerpyaedt_service_manager()On any Windows client machine:frompyaedt.common_rpcimportcreate_sessioncl1=create_session("server_name")cl1.aedt(port=50000,non_graphical=False)hfss=Hfss(machine="server_name",port=50000)# your code hereVariablesfrompyaedt.HFSSimportHFSSwithHFSSashfss:hfss["dim"]="1mm"# design variablehfss["$dim"]="1mm"# project variableModeler# Create a box, assign variables, and assign materials.frompyaedt.hfssimportHfsswithHfssashfss:hfss.modeler.create_box([0,0,0],[10,"dim",10],"mybox","aluminum")LicensePyAEDT is licensed under the MIT license.PyAEDT makes no commercial claim over Ansys whatsoever. This library extends the
functionality of AEDT by adding a Python interface to AEDT without changing the
core behavior or license of the original software. The use of PyAEDT requires a
legally licensed local copy of AEDT.To get a copy of AEDT, see theAnsys Electronicspage on the Ansys website.back to topIndices and tablesIndexModule IndexSearch Page