Desktop#
- class pyaedt.desktop.Desktop(specified_version=None, non_graphical=False, new_desktop_session=True, close_on_exit=True, student_version=False, machine='', port=0, aedt_process_id=None)[source]#
Provides the Ansys Electronics Desktop (AEDT) interface.
- Parameters:
- specified_version
str
,optional
Version of AEDT to use. The default is
None
, in which case the active setup or latest installed version is used.- non_graphicalbool,
optional
Whether to launch AEDT in non-graphical mode. The default is
False
, in which case AEDT is launched in graphical mode. This parameter is ignored when a script is launched within AEDT.- new_desktop_sessionbool,
optional
Whether to launch an instance of AEDT in a new thread, even if another instance of the
specified_version
is active on the machine. The default isTrue
.- close_on_exitbool,
optional
Whether to close AEDT on exit. The default is
True
.- student_versionbool,
optional
Whether to open the AEDT student version. The default is
False
.- machine
str
,optional
Machine name to connect the oDesktop session to. This parameters works only in 2022 R2 and later. The remote server must be up and running with the command “ansysedt.exe -grpcsrv portnum”. If the machine is “localhost”, the server also starts if not present.
- port
int
,optional
Port number on which to start the oDesktop communication on the already existing server. This parameter is ignored when creating a new server. It works only in 2022 R2 and later. The remote server must be up and running with the command “ansysedt.exe -grpcsrv portnum”.
- aedt_process_id
int
,optional
Process ID for the instance of AEDT to point PyAEDT at. The default is
None
. This parameter is only used whennew_desktop_session = False
.
- specified_version
Examples
Launch AEDT 2021 R1 in non-graphical mode and initialize HFSS.
>>> import pyaedt >>> desktop = pyaedt.Desktop("2021.2", non_graphical=True) PyAEDT INFO: pyaedt v... PyAEDT INFO: Python version ... >>> hfss = pyaedt.Hfss(designname="HFSSDesign1") PyAEDT INFO: Project... PyAEDT INFO: Added design 'HFSSDesign1' of type HFSS.
Launch AEDT 2021 R1 in graphical mode and initialize HFSS.
>>> desktop = Desktop("2021.2") PyAEDT INFO: pyaedt v... PyAEDT INFO: Python version ... >>> hfss = pyaedt.Hfss(designname="HFSSDesign1") PyAEDT INFO: No project is defined. Project...
Methods
Desktop.add_custom_toolkit
(toolkit_name)Add toolkit to AEDT Automation Tab.
Desktop.analyze_all
([project, design])Analyze all setups in a project.
Change a specific registry key to a new value.
Desktop.change_license_type
([license_type])Change the license type.
Desktop.change_registry_from_file
(registry_file)Apply desktop registry settings from an ACF file.
Desktop.change_registry_key
(key_full_name, ...)Change an AEDT registry key to a new value.
Clear all AEDT messages.
Close all projects and shut down AEDT.
Desktop.design_list
([project])Get a list of the designs.
Desktop.design_type
([project_name, design_name])Get the type of a design.
Disable the autosave option.
Enable the autosave option.
Get toolkit ready for installation.
Check and get monitor data of an existing analysis.
Get a list of projects.
Desktop.project_path
([project_name])Get the path to the project.
Desktop.release_desktop
([close_projects, ...])Release AEDT.
Desktop.save_project
([project_name, ...])Save the project.
Desktop.stop_simulations
([clean_stop])Check if there are simulation running and stops them.
Desktop.submit_job
(project_file, clustername)Submit a job to be solved on a cluster.
Attributes
AEDT version.
Check if there are simulation running.
Current AEDT version.
Current student AEDT version.
Installation path for AEDT.
AEDT logger.
Messenger manager for the AEDT logger.
PersonalLib directory.
PyAEDT directory.
Python source directory.
SysLib directory.
UserLib directory.
Version keys for AEDT.