NamedVariable#

class ansys.aedt.core.modeler.advanced_cad.stackup_3d.NamedVariable(application, name, expression)[source]#

Cast PyAEDT variable object to simplify getters and setters in Stackup3D.

Parameters:
applicationansys.aedt.core.hfss.Hfss

HFSS design or project where the variable is to be created.

namestr

The name of the variable. If the name begins with an ‘$’, the variable will be a project variable. Otherwise, it will be a design variable.

expressionstr

Expression of the value.

Examples

>>> from ansys.aedt.core import Hfss
>>> from ansys.aedt.core.modeler.advanced_cad.stackup_3d import NamedVariable
>>> hfss = Hfss()
>>> my_frequency = NamedVariable(hfss, "my_frequency", "900000Hz")
>>> wave_length_formula = "c0/" + my_frequency.name
>>> my_wave_length = NamedVariable(hfss, "my_wave_length", wave_length_formula)
>>> my_permittivity = NamedVariable(hfss, "my_permittivity", "2.2")
>>> my_wave_length.expression = my_wave_length.expression + "/" + my_permittivity.name

Methods

NamedVariable.hide_variable([value])

Set the variable to a hidden variable.

NamedVariable.read_only_variable([value])

Set the variable to a read-only variable.

Attributes

NamedVariable.evaluated_value

String that combines the numeric value and the units.

NamedVariable.expression

Expression of the variable as a string.

NamedVariable.name

Name of the variable as a string.

NamedVariable.numeric_value

Numeric part of the expression as a float value.

NamedVariable.unit_system

Unit system of the expression as a string.

NamedVariable.units

Units.

NamedVariable.value

Value.