add_variable#

Layout.add_variable(name, value, is_param=False)#

Add a variable.

Parameters:
namestr

Variable name.

valuestr, int, float, complex, Value

Value, which can be any type that can be converted to a Value instance.

is_parambool, default: False

Whether the new variable is a parameter. The default is False, which means it is a local variable.

Notes

Variables can be added to the following EDB objects:

Examples

Add variables to a cell and create a value that references these variables.

>>> param = Value(33.1)
>>> cell.add_variable("blue1", param)
>>> cell.add_variable("blue2", "25mm")
>>> vv = cell.create_value("blue1 + blue2")
>>> print(vv.double)
33.125