The helpers.py module#

Summary#

discover_available_aedt_sessions

Discover AEDT sessions currently running on the local system.

get_aedt_info

Get comprehensive information from an AEDT instance.

get_design_info

Get information about an AEDT application or design.

parse_aedt_version

Parse and normalize an AEDT version string.

get_design_type_map

Get a mapping from AEDT design-type strings to PyAEDT application classes.

resolve_design_app

Resolve and attach to the PyAEDT application for a target design.

Description#

Helper functions for PyAEDT-MCP.

This module provides utility functions for working with AEDT instances and extracting information from them.

Module detail#

helpers.discover_available_aedt_sessions() list[dict[str, Any]]#

Discover AEDT sessions currently running on the local system.

Returns:
list[dict[str, Any]]

Session metadata similar to the PyAEDT CLI session list output. Each entry includes whether the session is connectable from PyAEDT-MCP, which currently requires gRPC mode with a known port.

helpers.get_aedt_info(desktop: Any) dict[str, Any]#

Get comprehensive information from an AEDT instance.

Parameters:
desktopAny

AEDT instance.

Returns:
dict[str, Any]

Dictionary containing AEDT information including: - connection: Connection details (version, machine, port, grpc mode) - projects: List of open projects - active_project: Currently active project - installed_versions: Available AEDT versions

helpers.get_design_info(app: Any) dict[str, Any]#

Get information about an AEDT application or design.

Parameters:
appAny

AEDT application instance (such as HFSS, Maxwell3d, Icepak, and so on).

Returns:
dict[str, Any]

Dictionary containing design information.

helpers.parse_aedt_version(version_str: str | None) str | None#

Parse and normalize an AEDT version string.

Parameters:
version_strstr | None

Version string in various formats (such as “2026.1”, “261”, or “26.1”).

Returns:
str | None

Normalized version string or None if invalid.

helpers.get_design_type_map() dict[str, Any]#

Get a mapping from AEDT design-type strings to PyAEDT application classes.

The keys are the design-type identifiers returned by Desktop.design_type(). The values are the corresponding PyAEDT application classes that can be instantiated to attach to an existing AEDT session.

Returns:
dict[str, Any]

Mapping of design-type string to a PyAEDT application class.

helpers.resolve_design_app(desktop: Any, project_name: str | None = None, design_name: str | None = None) tuple[Any, str | None, str | None]#

Resolve and attach to the PyAEDT application for a target design.

Parameters:
desktopAny

Connected AEDT instance.

project_namestr, default: None

Project name to resolve. If None, the active project is used.

design_namestr, default: None

Design name to resolve. If None, the active design is used.

Returns:
tuple[Any, str | None, str | None]

Tuple containing the attached PyAEDT application instance, resolved project name, and resolved design name.

Raises:
RuntimeError

If the design type is unsupported.

helpers.logger#