Actions#
The FrontendGeneric
class provides a generic UI for controlling the toolkit. A backend must be running previously.
- class ansys.aedt.toolkits.common.ui.actions_generic.FrontendGeneric[source]#
This class provides a generic frontend for controlling the toolkit.
- backend_busy()[source]#
Check if the backend is currently busy.
- Returns:
- bool
True
if the backend is busy,False
otherwise.
- check_connection()[source]#
Check the backend connection.
- Returns:
- bool
True
when successful,False
when failed.
- find_process_ids(version, non_graphical)[source]#
Find AEDT sessions based on the selected version and graphical mode.
- get_aedt_data()[source]#
Get a list of AEDT projects.
- Returns:
list
A list of AEDT project names. Returns [“No Project”] if no projects are available.
- get_aedt_model(project_selected, design_selected, air_objects=True, encode=True, obj_list=None, export_path=None, export_as_single_objects=True)[source]#
Get AEDT model.
- Parameters:
- project_selected
str
Project name.
- design_selected
str
Design name.
- air_objectsbool,
optional
Define if air and vacuum objects will be exported.
- encodebool,
optional
Whether to encode the file. The default is
True
.- obj_list
list
,optional
List of objects to export. The default is
None
, in which case every model object except 3D, vacuum, and air objects are exported.- export_path
str
,optional
Full path of the exported OBJ file. The default is
None
, in which case the file is exported in the working directory.- export_as_single_objectsbool,
optional
Whether to export the model as a single object. The default is
True
. IfFalse
, the model is exported as a list of objects for each object.
- project_selected
- Returns:
- bool
True
when successful,False
when failed.
- static get_project_name(project_path)[source]#
Get project name from project path.
- Returns:
str
Project name
- log_and_update_progress(msg, log_level: str = 'debug', progress: int | None = None)[source]#
Log a message and update the progress bar.
This method logs the given message at the specified log level, and updates the progress bar to the given progress percentage if provided.
- open_project(selected_project)[source]#
Open an AEDT project.
- Parameters:
- selected_project
str
The path to the selected AEDT project.
- selected_project
- static poll_url(url: str, timeout: int = 10)[source]#
Perform GET requests on URL.
Continuously perform GET requests to the specified URL until a valid response is received.
- save_project()[source]#
Save the current AEDT project.
Opens a file dialog to select a location to save the AEDT project. The project is saved with a ‘.aedt’ extension.
- Note:
This method relies on backend communication to save the project.
- Returns:
- set_properties(data)[source]#
Set properties in the backend.
- Parameters:
- data
dict
Dictionary of properties to set.
- data
You can modify the default properties with the following script:
# Import API
from ansys.aedt.toolkits.common.ui.models import general_settings
general_settings.high_resolution = False