VariableManager#
- class ansys.aedt.core.application.variables.VariableManager(app)#
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:
- variables
dict
Dictionary of all design properties and project variables in the active design.
- design_variables
dict
Dictionary of all design properties in the active design.
- project_variables
dict
Dictionary of all project variables available to the active design (key by variable name).
- dependent_variables
dict
Dictionary of all dependent variables available to the active design (key by variable name).
- independent_variables
dict
Dictionary of all independent variables (constant numeric values) available to the active design (key by variable name).
- independent_design_variables
dict
- independent_project_variables
dict
- variable_names
str
orlist
One or more variable names.
- project_variable_names
str
orlist
One or more project variable names.
- design_variable_names
str
orlist
One or more design variable names.
- dependent_variable_names
str
orlist
All dependent variable names within the project.
- independent_variable_names
list
of
str
All independent variable names within the project. These can be sweep variables for optimetrics.
- independent_project_variable_names
str
orlist
All independent project variable names within the project. These can be sweep variables for optimetrics.
- independent_design_variable_names
str
orlist
All independent design properties (local variables) within the project. These can be sweep variables for optimetrics.
- variables
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
Retrieve an AEDT object.
VariableManager.decompose
(variable)Decompose a variable string to a floating with its unit.
Delete a separator from either the active project or design.
Delete unused design and project variables.
Delete a variable.
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
List of dependent design variables.
Dependent design variables.
List of dependent project variables.
Dependent project variables.
List of dependent variables.
Dependent variables.
List of design variables.
Design variables.
List of independent design variables.
Independent design variables.
List of independent project variables.
Independent project variables.
List of independent variables.
Independent variables.
Post Processing variables.
List of project variables.
Project variables.
List of variables.
Variables.