pyaedt.application.Variables.Variable

class pyaedt.application.Variables.Variable(expression, units=None, si_value=None, full_variables=None, name=None, app=None, readonly=False, hidden=False, description=None, postprocessing=False, circuit_parameter=True)[source]

Stores design properties and project variables and provides operations to perform on them.

Parameters
valuefloat, str

Numerical value of the variable in SI units.

unitsstr

Units for the value.

Examples

>>> from pyaedt.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

Variable.format(format)

Retrieve the string value with the specified numerical formatting.

Variable.rescale_to(units)

Rescale the expression to a new unit within the current unit system.

Attributes

Variable.circuit_parameter

Circuit parameter flag value.

Variable.description

Description value.

Variable.evaluated_value

String value.

Variable.expression

Expression.

Variable.hidden

Hidden flag value.

Variable.name

Variable name.

Variable.numeric_value

Numeric part of the expression as a float value.

Variable.post_processing

Postprocessing flag value.

Variable.read_only

Read-only flag value.

Variable.unit_system

Unit system of the expression as a string.

Variable.units

Units.

Variable.value

Value.