Mechanical#

class ansys.aedt.core.mechanical.Mechanical(project=None, design=None, solution_type=None, setup=None, version=None, non_graphical=False, new_desktop=False, close_on_exit=False, student_version=False, machine='', port=0, aedt_process_id=None, remove_lock=False)[source]#

Provides the Mechanical application interface.

Parameters:
projectstr, optional

Name of the project to select or the full path to the project or AEDTZ archive to open. The default is None, in which case an attempt is made to get an active project. If no projects are present, an empty project is created.

designstr, optional

Name of the design to select. The default is None, in which case an attempt is made to get an active design. If no designs are present, an empty design is created.

solution_typestr, optional

Solution type to apply to the design. The default is None, in which case the default type is applied.

setupstr, optional

Name of the setup to use as the nominal. The default is None, in which case the active setup is used or nothing is used.

versionstr, int, float, optional

Version of AEDT to use. The default is None, in which case the active version or latest installed version is used. This parameter is ignored when a script is launched within AEDT. Examples of input values are 232, 23.2,``2023.2``,``”2023.2”``.

non_graphicalbool, optional

Whether to launch AEDT in the non-graphical mode. The default is False, in which case AEDT is launched in the graphical mode. This parameter is ignored when a script is launched within AEDT.

new_desktopbool, 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 is False. This parameter is ignored when a script is launched within AEDT.

close_on_exitbool, optional

Whether to release AEDT on exit. The default is False.

student_versionbool, optional

Whether to open the AEDT student version. The default is False. This parameter is ignored when a script is launched within AEDT.

machinestr, optional

Machine name to connect the oDesktop session to. Works only in 2022R2 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.

portint, optional

Port number on which to start the oDesktop communication on an already existing server. This parameter is ignored when creating a new server. It works only in 2022 R2 or later. The remote server must be up and running with the command “ansysedt.exe -grpcsrv portnum”.

aedt_process_idint, optional

Process ID for the instance of AEDT to point PyAEDT at. The default is None. This parameter is only used when new_desktop = False.

remove_lockbool, optional

Whether to remove lock to project before opening it or not. The default is False, which means to not unlock the existing project if needed and raise an exception.

Examples

Create an instance of Mechanical and connect to an existing HFSS design or create a new HFSS design if one does not exist.

>>> from ansys.aedt.core import Mechanical
>>> aedtapp = Mechanical()

Create an instance of Mechanical and link to a project named "projectname". If this project does not exist, create one with this name.

>>> aedtapp = Mechanical(projectname)

Create an instance of Mechanical and link to a design named "designname" in a project named "projectname".

>>> aedtapp = Mechanical(projectname,designame)

Create an instance of Mechanical and open the specified project, which is named "myfile.aedt".

>>> aedtapp = Mechanical("myfile.aedt")

Create a Desktop on 2023 R2 object and then create an Mechanical object and open the specified project, which is named "myfile.aedt".

>>> aedtapp = Mechanical(version=23.2, project="myfile.aedt")

Methods

Mechanical.activate_variable_optimization(name)

Activate optimization analysis for a variable and optionally set up ranges.

Mechanical.activate_variable_sensitivity(name)

Activate sensitivity analysis for a variable and optionally set up ranges.

Mechanical.activate_variable_statistical(name)

Activate statitistical analysis for a variable and optionally set up ranges.

Mechanical.activate_variable_tuning(name[, ...])

Activate tuning analysis for a variable and optionally set up ranges.

Mechanical.add_error_message(text[, level])

Add a type 0 "Error" message to either the global, active project, or active design level of the message mmanager tree.

Mechanical.add_from_toolkit(toolkit[, draw])

Add a new toolkit to the current application.

Mechanical.add_info_message(text[, level])

Add a type 0 "Info" message to either the global, active project, or active design level of the message manager tree.

Mechanical.add_stackup_3d()

Create a stackup 3D object.

Mechanical.add_warning_message(text[, level])

Add a type 0 "Warning" message to either the global, active project, or active design level of the message manager tree.

Mechanical.analyze([setup, cores, tasks, ...])

Solve the active design.

Mechanical.analyze_setup([name, cores, ...])

Analyze a design setup.

Mechanical.archive_project([project_path, ...])

Archive the AEDT project and add a message.

Mechanical.assign_2way_coupling([setup, ...])

Assign two-way coupling to a setup.

Mechanical.assign_em_losses([design, setup, ...])

Map EM losses to a Mechanical design.

Mechanical.assign_fixed_support(assignment)

Assign a Mechanical fixed support.

Mechanical.assign_frictionless_support(...)

Assign a Mechanical frictionless support.

Mechanical.assign_heat_flux(assignment, ...)

Assign heat flux boundary condition to an object or face list.

Mechanical.assign_heat_generation(...[, name])

Assign a heat generation boundary condition to an object list.

Mechanical.assign_material(assignment, material)

Assign a material to one or more objects.

Mechanical.assign_thermal_map(object_list[, ...])

Map thermal losses to a Mechanical design.

Mechanical.assign_uniform_convection(assignment)

Assign a uniform convection to the face list.

Mechanical.assign_uniform_temperature(assignment)

Assign a uniform temperature boundary.

Mechanical.assignmaterial_from_sherlock_files(...)

Assign material to objects in a design based on a CSV file obtained from Sherlock.

Mechanical.autosave_disable()

Disable autosave in AEDT.

Mechanical.autosave_enable()

Enable autosave in AEDT.

Mechanical.change_automatically_use_causal_materials([...])

Enable or disable the automatic use of causal materials for lossy dielectrics.

Mechanical.change_design_settings(settings)

Set Design Settings.

Mechanical.change_material_override([...])

Enable or disable the material override in the project.

Mechanical.change_property(aedt_object, ...)

Change a property.

Mechanical.change_validation_settings([...])

Update the validation design settings.

Mechanical.check_beta_option_enabled(beta_option)

Check if a beta option is enabled.

Mechanical.check_if_project_is_loaded(input_file)

Check if a project path is already loaded in active Desktop.

Mechanical.clean_proj_folder([directory, name])

Delete a project folder.

Mechanical.cleanup_solution([variations, ...])

Delete a set of Solution Variations or part of them.

Mechanical.close_desktop()

Close AEDT and release it.

Mechanical.close_project([name, save])

Close an AEDT project.

Mechanical.copy_design_from(project, design)

Copy a design from a project into the active project.

Mechanical.copy_project(destination, name)

Copy the project to another destination.

Mechanical.copy_solid_bodies_from(design[, ...])

Copy a list of objects and user defined models from one design to the active design.

Mechanical.create_dataset(name, x, y[, z, ...])

Create a dataset.

Mechanical.create_dataset1d_design(name, x, y)

Create a design dataset.

Mechanical.create_dataset1d_project(name, x, y)

Create a project dataset.

Mechanical.create_dataset3d(name, x, y[, z, ...])

Create a 3D dataset.

Mechanical.create_new_project(name)

Create a project within AEDT.

Mechanical.create_output_variable(variable, ...)

Create or modify an output variable.

Mechanical.create_setup([name, setup_type])

Create an analysis setup for Mechanical.

Mechanical.dataset_exists(name[, ...])

Check if a dataset exists.

Mechanical.deactivate_variable_optimization(name)

Deactivate the optimization analysis for a variable.

Mechanical.deactivate_variable_sensitivity(name)

Deactivate the sensitivity analysis for a variable.

Mechanical.deactivate_variable_statistical(name)

Deactivate the statistical analysis for a variable.

Mechanical.deactivate_variable_tuning(name)

Deactivate the tuning analysis for a variable.

Mechanical.delete_design([name, fallback_design])

Delete a design from the current project.

Mechanical.delete_project(name)

Delete a project.

Mechanical.delete_separator(name)

Delete a separator from either the active project or a design.

Mechanical.delete_setup(name)

Delete a setup.

Mechanical.delete_unused_variables()

Delete design and project unused variables.

Mechanical.delete_variable(name)

Delete a variable.

Mechanical.design_variation([variation])

Generate a string to specify a desired variation.

Mechanical.duplicate_design(name[, ...])

Copy a design to a new name.

Mechanical.edit_notes(text)

Edit notes.

Mechanical.edit_setup(name, properties)

Modify a setup.

Mechanical.evaluate_expression(expression)

Evaluate a valid string expression and return the numerical value in SI units.

Mechanical.export_3d_model([file_name, ...])

Export the 3D model.

Mechanical.export_convergence(setup[, ...])

Export a solution convergence to a file.

Mechanical.export_design_preview_to_jpg(...)

Export design preview image to a JPG file.

Mechanical.export_mesh_stats(setup[, ...])

Export mesh statistics to a file.

Mechanical.export_parametric_results(sweep, ...)

Export a list of all parametric variations solved for a sweep to a CSV file.

Mechanical.export_profile(setup[, ...])

Export a solution profile to a PROF file.

Mechanical.export_results([analyze, ...])

Export all available reports to a file, including profile, and convergence and sNp when applicable.

Mechanical.export_rl_matrix(matrix_name, ...)

Export R/L matrix after solving.

Mechanical.export_variables_to_csv(output_file)

Export design properties, project variables, or both to a CSV file.

Mechanical.flatten_3d_components([...])

Flatten one or multiple 3d components in the actual layout.

Mechanical.generate_temp_project_directory(name)

Generate a unique directory string to save a project to.

Mechanical.generate_unique_setup_name([name])

Generate a new setup with a unique name.

Mechanical.get_all_conductors_names()

Retrieve all conductors in the active design.

Mechanical.get_all_dielectrics_names()

Retrieve all dielectrics in the active design.

Mechanical.get_all_source_modes()

Retrieve all source modes.

Mechanical.get_all_sources()

Retrieve all setup sources.

Mechanical.get_components3d_vars(component_name)

Read the A3DCOMP file and check for variables.

Mechanical.get_dxf_layers(file_path)

Read a DXF file and return all layer names.

Mechanical.get_evaluated_value(name[, units])

Retrieve the evaluated value of a design property or project variable in SI units if no unit is provided.

Mechanical.get_module(module_name)

Aedt Module object.

Mechanical.get_monitor_data()

Check and get monitor data of an existing analysis.

Mechanical.get_nominal_variation([with_values])

Retrieve the nominal variation.

Mechanical.get_object_material_properties([...])

Retrieve the material properties for a list of objects and return them in a dictionary.

Mechanical.get_oo_name(aedt_object[, ...])

Return the object-oriented AEDT property names.

Mechanical.get_oo_object(aedt_object, ...)

Return the Object Oriented AEDT Object.

Mechanical.get_oo_properties(aedt_object, ...)

Return the Object Oriented AEDT Object Properties.

Mechanical.get_oo_property_value(...)

Return the Object Oriented AEDT Object Properties.

Mechanical.get_output_variable(variable[, ...])

Retrieve the value of the output variable.

Mechanical.get_profile([name])

Get profile information.

Mechanical.get_property_value(assignment, ...)

Retrieve a property value.

Mechanical.get_registry_key_int(name)

Get the value for the AEDT registry key if one exists.

Mechanical.get_registry_key_string(name)

Get the value for the AEDT registry key if one exists.

Mechanical.get_setup(name)

Get the setup from the current design.

Mechanical.get_setups()

Retrieve setups.

Mechanical.get_sweeps(name)

Retrieve all sweeps for a setup.

Mechanical.get_traces_for_plot([...])

Retrieve a list of traces of specified designs ready to use in plot reports.

Mechanical.hidden_variable(name[, value])

Set the variable to a hidden or unhidden variable.

Mechanical.identify_touching_conductors([...])

Identify all touching components and group in a dictionary.

Mechanical.import_3d_cad(input_file[, ...])

Import a CAD model.

Mechanical.import_dataset1d(input_file[, ...])

Import a 1D dataset.

Mechanical.import_dataset3d(input_file[, ...])

Import a 3D dataset.

Mechanical.import_dxf(file_path, layers[, ...])

Import a DXF file.

Mechanical.import_gds_3d(input_file, ...[, ...])

Import a GDSII file.

Mechanical.insert_design([name, solution_type])

Add a design of a specified type.

Mechanical.list_of_variations([setup, sweep])

Retrieve a list of active variations for input setup.

Mechanical.load_project(file_name[, design, ...])

Open an AEDT project based on a project and optional design.

Mechanical.number_with_units(value[, units])

Convert a number to a string with units.

Mechanical.plot([assignment, show, ...])

Plot the model or a subset of objects.

Mechanical.read_design_data()

Read back the design data as a dictionary.

Mechanical.read_only_variable(name[, value])

Set the variable to a read-only or not read-only variable.

Mechanical.release_desktop([close_projects, ...])

Release AEDT.

Mechanical.remove_all_unused_definitions()

Remove all unused definitions in the project.

Mechanical.rename_design(name[, save])

Rename the active design.

Mechanical.save_project([file_name, ...])

Save the project and add a message.

Mechanical.set_active_design(name)

Change the active design to another design.

Mechanical.set_active_dso_config_name([...])

Change a specific registry key to a new value.

Mechanical.set_license_type([license_type])

Change the license type between "Pack" and "Pool".

Mechanical.set_oo_property_value(...)

Change the property value of the object-oriented AEDT object.

Mechanical.set_registry_from_file(registry_file)

Apply desktop registry settings from an ACT file.

Mechanical.set_registry_key(name, value)

Change a specific registry key to a new value.

Mechanical.set_source_context(sources[, ...])

Set the source context.

Mechanical.set_temporary_directory(path)

Set temporary directory path.

Mechanical.solve_in_batch([file_name, ...])

Analyze a design setup in batch mode.

Mechanical.stop_simulations([clean_stop])

Check if there are simulation running and stops them.

Mechanical.submit_job(cluster_name[, ...])

Submit a job to be solved on a cluster.

Mechanical.validate_simple([log_file])

Validate a design.

Mechanical.value_with_units(value[, units, ...])

Combine a number and a string containing the modeler length unit in a single string e.g. "1.2mm".

Attributes

Mechanical.Position

Position of the object.

Mechanical.SimulationSetupTypes

Simulation setup types.

Mechanical.SolutionTypes

Solution types.

Mechanical.active_setup

Get or Set the name of the active setup.

Mechanical.aedt_version_id

AEDT version.

Mechanical.are_there_simulations_running

Check if there are simulation running.

Mechanical.available_variations

Available variation object.

Mechanical.boundaries

Design boundaries and excitations.

Mechanical.boundaries_by_type

Design boundaries by type.

Mechanical.components3d

3D components.

Mechanical.configurations

Property to import and export configuration files.

Mechanical.default_solution_type

Default solution type.

Mechanical.design_datasets

Dictionary of Design Datasets.

Mechanical.design_list

Design list.

Mechanical.design_name

Design name.

Mechanical.design_properties

Design properties.

Mechanical.design_type

Design type.

Mechanical.desktop_class

Desktop class.

Mechanical.desktop_install_dir

AEDT installation directory.

Mechanical.excitation_objects

Get all excitation.

Mechanical.excitations

Get all excitation names.

Mechanical.excitations_by_type

Design excitations by type.

Mechanical.existing_analysis_setups

Existing analysis setups.

Mechanical.existing_analysis_sweeps

Existing analysis sweeps in the design.

Mechanical.info

Dictionary of the PyAEDT session information.

Mechanical.layouteditor

Return the Circuit Layout Editor.

Mechanical.library_list

Library list.

Mechanical.lock_file

Lock file.

Mechanical.logger

Logger for the design.

Mechanical.materials

Materials in the project.

Mechanical.mesh

Mesh.

Mechanical.modeler

Modeler.

Mechanical.native_component_names

Native component names.

Mechanical.native_components

Native Component dictionary.

Mechanical.nominal_adaptive

Nominal adaptive sweep.

Mechanical.nominal_sweep

Nominal sweep.

Mechanical.o_component_manager

Component manager object.

Mechanical.o_maxwell_parameters

AEDT Maxwell Parameter Setup Object.

Mechanical.o_model_manager

Model manager object.

Mechanical.o_symbol_manager

Aedt Symbol Manager.

Mechanical.oanalysis

Analysis AEDT Module.

Mechanical.oboundary

Boundary Object.

Mechanical.odefinition_manager

Definition Manager Module.

Mechanical.odesign

Design.

Mechanical.odesktop

AEDT instance containing all projects and designs.

Mechanical.oeditor

Oeditor Module.

Mechanical.oexcitation

Solution Module.

Mechanical.ofieldsreporter

Fields reporter.

Mechanical.oimport_export

Import/Export Manager Module.

Mechanical.omaterial_manager

Material Manager Module.

Mechanical.omatrix

Matrix Object.

Mechanical.omeshmodule

Icepak Mesh Module.

Mechanical.omodelsetup

AEDT Model Setup Object.

Mechanical.omonitor

AEDT Monitor Object.

Mechanical.ooptimetrics

AEDT Optimetrics Module.

Mechanical.ooutput_variable

AEDT Output Variable Module.

Mechanical.opadstackmanager

AEDT oPadstackManager.

Mechanical.oproject

Project property.

Mechanical.optimizations

Optimizations in the project.

Mechanical.oradfield

AEDT Radiation Field Object.

Mechanical.oreportsetup

Report setup.

Mechanical.osolution

Solution Module.

Mechanical.output_variables

List of output variables.

Mechanical.parametrics

Setups in the project.

Mechanical.personallib

PersonalLib directory.

Mechanical.ports

Design excitations.

Mechanical.post

PostProcessor.

Mechanical.project_datasets

Dictionary of project datasets.

Mechanical.project_file

Project name and path.

Mechanical.project_list

Project list.

Mechanical.project_name

Project name.

Mechanical.project_path

Project path.

Mechanical.project_properties

Project properties.

Mechanical.project_time_stamp

Return Project time stamp.

Mechanical.project_timestamp_changed

Return a bool if time stamp changed or not.

Mechanical.pyaedt_dir

PyAEDT directory.

Mechanical.results_directory

Results directory.

Mechanical.settings

Settings of the current Python/Pyaedt session.

Mechanical.setup_names

Setup names.

Mechanical.setups

Setups in the project.

Mechanical.solution_type

Solution type.

Mechanical.src_dir

Source directory for Python.

Mechanical.syslib

SysLib directory.

Mechanical.temp_directory

Path to the temporary directory.

Mechanical.toolkit_directory

Path to the toolkit directory.

Mechanical.userlib

UserLib directory.

Mechanical.valid_design

Valid design.

Mechanical.variable_manager

Variable manager for creating and managing project design and postprocessing variables.

Mechanical.working_directory

Path to the working directory.