VariableManager#

class ansys.aedt.core.application.variables.VariableManager(app)[source]#

Manages design properties and project variables.

Design properties are the local variables in a design. Project variables are defined at the project level and start with $.

This class provides access to all variables or a subset of the variables. Manipulation of the numerical or string definitions of variable values is provided in the ansys.aedt.core.application.variables.Variable class.

Parameters:
variablesdict

Dictionary of all design properties and project variables in the active design.

design_variablesdict

Dictionary of all design properties in the active design.

project_variablesdict

Dictionary of all project variables available to the active design (key by variable name).

dependent_variablesdict

Dictionary of all dependent variables available to the active design (key by variable name).

independent_variablesdict

Dictionary of all independent variables (constant numeric values) available to the active design (key by variable name).

independent_design_variablesdict
independent_project_variablesdict
variable_namesstr or list

One or more variable names.

project_variable_namesstr or list

One or more project variable names.

design_variable_namesstr or list

One or more design variable names.

dependent_variable_namesstr or list

All dependent variable names within the project.

independent_variable_nameslist of str

All independent variable names within the project. These can be sweep variables for optimetrics.

independent_project_variable_namesstr or list

All independent project variable names within the project. These can be sweep variables for optimetrics.

independent_design_variable_namesstr or list

All independent design properties (local variables) within the project. These can be sweep variables for optimetrics.

Examples

>>> from ansys.aedt.core.maxwell import Maxwell3d
>>> from ansys.aedt.core.desktop import Desktop
>>> d = Desktop()
>>> aedtapp = Maxwell3d()

Define some test variables.

>>> aedtapp["Var1"] = 3
>>> aedtapp["Var2"] = "12deg"
>>> aedtapp["Var3"] = "Var1 * Var2"
>>> aedtapp["$PrjVar1"] = "pi"

Get the variable manager for the active design.

>>> v = aedtapp.variable_manager

Get a dictionary of all project and design variables.

>>> v.variables
{'Var1': <ansys.aedt.core.application.variables.Variable at 0x2661f34c448>,
 'Var2': <ansys.aedt.core.application.variables.Variable at 0x2661f34c308>,
 'Var3': <ansys.aedt.core.application.variables.Expression at 0x2661f34cb48>,
 '$PrjVar1': <ansys.aedt.core.application.variables.Expression at 0x2661f34cc48>}

Get a dictionary of only the design variables.

>>> v.design_variables
{'Var1': <ansys.aedt.core.application.variables.Variable at 0x2661f339508>,
 'Var2': <ansys.aedt.core.application.variables.Variable at 0x2661f3415c8>,
 'Var3': <ansys.aedt.core.application.variables.Expression at 0x2661f341808>}

Get a dictionary of only the independent design variables.

>>> v.independent_design_variables
{'Var1': <ansys.aedt.core.application.variables.Variable at 0x2661f335d08>,
 'Var2': <ansys.aedt.core.application.variables.Variable at 0x2661f3557c8>}

Methods

VariableManager.aedt_object(name)

Retrieve an AEDT object.

VariableManager.decompose(variable)

Decompose a variable string to a floating with its unit.

VariableManager.delete_separator(name)

Delete a separator from either the active project or design.

VariableManager.delete_unused_variables()

Delete unused design and project variables.

VariableManager.delete_variable(name)

Delete a variable.

VariableManager.get_expression(name)

Retrieve the variable value of a project or design variable as a string.

VariableManager.is_used(name)

Find if a variable is used.

VariableManager.set_variable(name[, ...])

Set the value of a design property or project variable.

Attributes

VariableManager.dependent_design_variable_names

List of dependent design variables.

VariableManager.dependent_design_variables

Dependent design variables.

VariableManager.dependent_project_variable_names

List of dependent project variables.

VariableManager.dependent_project_variables

Dependent project variables.

VariableManager.dependent_variable_names

List of dependent variables.

VariableManager.dependent_variables

Dependent variables.

VariableManager.design_variable_names

List of design variables.

VariableManager.design_variables

Design variables.

VariableManager.independent_design_variable_names

List of independent design variables.

VariableManager.independent_design_variables

Independent design variables.

VariableManager.independent_project_variable_names

List of independent project variables.

VariableManager.independent_project_variables

Independent project variables.

VariableManager.independent_variable_names

List of independent variables.

VariableManager.independent_variables

Independent variables.

VariableManager.post_processing_variables

Post Processing variables.

VariableManager.project_variable_names

List of project variables.

VariableManager.project_variables

Project variables.

VariableManager.variable_names

List of variables.

VariableManager.variables

Variables.