Value#

class ansys.edb.core.utility.value.Value(val, _owner=None)#

Represents a number or an expression.

Notes

A value can be either a constant (such as 1, 2.35, "7+0.3i", and "23mm") or parametric (such as.``w1 + w2``).

If the value is parametric, the _owner attribute must be set to the object that hosts the variables used. If the owner is Cell or Layout, the expression can reference both database variables and cell variables. A better way to create a parametric values is to call the obj_with_variables.create_value(str) method, which automatically sets the _owner parameter to the correct object.

Values can be used in expressions with the following operators:

Mathematical operators supported by values#

Operator

Operation

Return Value

+

addition

Value

-

subtraction or negation

Value

*

multiplication

Value

/

division

Value

//

floor division

integer

**

power

Value

==

equality

bool

<

less than

bool

>

greater than

bool

The value is evaluated to a constant (if it is parametric) before applying the operators.

Attributes:
valValueLike

Value assigned to the new value.

_ownerNone, Database,

Cell, Layout, ComponentDef

Methods

Value.equals(other[, tolerance])

Check if this value and other value are equivalent when evaluated.

Attributes

Value.complex

complex: Complex value from the value object.

Value.double

float: Float from the value object.

Value.is_complex

bool: Flag indicating if the the value is a complex number (has a non-zero imaginary part).

Value.is_parametric

bool: Flag indicating if the value is parametric (dependent on variables).

Value.sqrt

Square root of this value as a constant value.

Value.value

complex: Evaluation to a constant and return as a float or complex.