Variable#
- class ansys.aedt.core.application.variables.Variable(expression: float | str, units: str | None = None, si_value: float | None = None, full_variables: dict | None = None, name: str | None = None, app=None, readonly: bool | None = False, hidden: bool | None = False, sweep: bool | None = True, description: str | None = None, postprocessing: bool | None = False, circuit_parameter: bool | None = True)#
Stores design properties and project variables and provides operations to perform on them.
- Parameters:
- expression
floatorstr Variable expression.
- units
str,optional Unit string to enforce. If provided, must be consistent with parsed units.
- si_value
float,optional Value in SI units. If provided, it overrides the parsed/calculated value.
- full_variables
dict,optional Map of known variables for expression decomposition.
- name
str,optional Variable name in AEDT.
- app
object,optional AEDT application of type
ansys.aedt.core.application.- readonlybool,
optional Flag controlling read only property. The default is
False.- hiddenbool,
optional Flags controlling hidden property. The default is
False.- sweepbool,
optional Flags controlling sweep property. The default is
True.- postprocessingbool,
optional Flags controlling postprocessing property.
- circuit_parameterbool,
optional Define Parameter Default variable in Circuit design.
- expression
Examples
>>> from ansys.aedt.core.application.variables import Variable
Define a variable using a string value consistent with the AEDT properties.
>>> v = Variable("45mm")
Define an unitless variable with a value of 3.0.
>>> v = Variable(3.0)
Define a variable defined by a numeric result and a unit string.
>>> v = Variable(3.0 * 4.5, units="mm") >>> assert v.numeric_value = 13.5 >>> assert v.units = "mm"
Methods
Decompose the evaluated expression into a floating-point number and units.
Variable.format(fmt)Return the string value using the specified numeric format ('06.2f').
Variable.rescale_to(units)Rescale the expression to the provided units within the same unit system.
Push the current variable state to AEDT via variable manager.
Attributes
Current description.
Concatenated numeric value and unit string.
Raw AEDT expression.
Whether the design type has DefinitionParameters or only LocalVariables.
Current hidden flag.
Whether this variable is a circuit parameter (for supported design types).
Whether optimization is enabled for this variable.
Whether sensitivity analysis is enabled.
Whether statistical analysis is enabled.
Whether tuning is enabled.
Variable name.
Numeric value of the expression in current units.
Optimization upper bound.
Optimization lower bound.
Whether this variable is a post-processing variable.
Shortcut for dir(self).
Current read-only flag.
Sensitivity initial displacement (if applicable).
Sensitivity upper bound.
Sensitivity lower bound.
Current value in SI units (float).
Current sweep flag.
Tuning upper bound.
Tuning lower bound.
Tuning step value.
Unit system name.
Unit string associated with the expression.