KLayout 0.29.8 (2024-11-26 926dac96c) [master]

API reference - Class Instance

Notation used in Ruby API documentation

Module: db

Description: An instance proxy

An instance proxy is basically a pointer to an instance of different kinds, similar to Shape, the shape proxy. Instance objects can be duplicated without creating copies of the instances itself: the copy will still point to the same instance than the original.

When the Instance object is modified, the actual instance behind it is modified. The Instance object acts as a simplified interface for single and array instances with or without properties.

See The Database API for more details about the database objects.

Public constructors

new Instance ptrnewCreates a new object of this class

Public methods

[const]bool!=(const Instance b)Tests for inequality of two Instance objects
[const]bool<(const Instance b)Provides an order criterion for two Instance objects
[const]bool==(const Instance b)Tests for equality of two Instance objects
[const]variant[](variant key)Gets the user property with the given key or, if available, the PCell parameter with the name given by the key
void[]=(variant key,
variant value)
Sets the user property with the given key or, if available, the PCell parameter with the name given by the key
[const]Instance ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]VectoraReturns the displacement vector for the 'a' axis
voida=(const Vector a)Sets the displacement vector for the 'a' axis
voida=(const DVector a)Sets the displacement vector for the 'a' axis in micrometer units
voidassign(const Instance other)Assigns another object to self
[const]VectorbReturns the displacement vector for the 'b' axis
voidb=(const Vector b)Sets the displacement vector for the 'b' axis
voidb=(const DVector b)Sets the displacement vector for the 'b' axis in micrometer units
[const]BoxbboxGets the bounding box of the instance
[const]Boxbbox(unsigned int layer_index)Gets the bounding box of the instance for a given layer
Cell ptrcellGets the Cell object of the cell this instance refers to
[const]const Cell ptrcellGets the Cell object of the cell this instance refers to
voidcell=(const Cell ptr cell)Sets the Cell object this instance refers to
[const]unsigned intcell_indexGet the index of the cell this instance refers to
voidcell_index=(unsigned int cell_index)Sets the index of the cell this instance refers to
[const]CellInstArraycell_instGets the basic CellInstArray object associated with this instance reference.
voidcell_inst=(const CellInstArray inst)Changes the CellInstArray object to the given one.
voidcell_inst=(const DCellInstArray inst)Returns the basic cell instance array object by giving a micrometer unit object.
voidchange_pcell_parameter(string name,
variant value)
Changes a single parameter of a PCell instance to the given value
voidchange_pcell_parameters(variant[] params)Changes the parameters of a PCell instance to the list of parameters
voidchange_pcell_parameters(map<string,variant> dict)Changes the parameters of a PCell instance to the dictionary of parameters
voidconvert_to_staticConverts a PCell instance to a static cell
[const]ICplxTranscplx_transGets the complex transformation of the instance or the first instance in the array
voidcplx_trans=(const ICplxTrans t)Sets the complex transformation of the instance or the first instance in the array
voidcplx_trans=(const DCplxTrans t)Sets the complex transformation of the instance or the first instance in the array (in micrometer units)
[const]DVectordaReturns the displacement vector for the 'a' axis in micrometer units
voidda=(const DVector a)Sets the displacement vector for the 'a' axis in micrometer units
[const]DVectordbReturns the displacement vector for the 'b' axis in micrometer units
voiddb=(const DVector b)Sets the displacement vector for the 'b' axis in micrometer units
[const]DBoxdbboxGets the bounding box of the instance in micron units
[const]DBoxdbbox(unsigned int layer_index)Gets the bounding box of the instance in micron units
DCellInstArraydcell_instReturns the micrometer unit version of the basic cell instance array object.
voiddcell_inst=(const DCellInstArray inst)Returns the basic cell instance array object by giving a micrometer unit object.
[const]DCplxTransdcplx_transGets the complex transformation of the instance or the first instance in the array (in micrometer units)
voiddcplx_trans=(const DCplxTrans t)Sets the complex transformation of the instance or the first instance in the array (in micrometer units)
voiddeleteDeletes this instance
voiddelete_property(variant key)Deletes the user property with the given key
[const]DTransdtransGets the transformation of the instance or the first instance in the array (in micrometer units)
voiddtrans=(const DTrans t)Sets the transformation of the instance or the first instance in the array (in micrometer units)
[const]new Instance ptrdupCreates a copy of self
voidexplodeExplodes the instance array
voidflattenFlattens the instance
voidflatten(int levels)Flattens the instance
[const]boolhas_prop_id?Returns true, if the instance has properties
[const]boolis_complex?Tests, if the array is a complex array
[const]boolis_null?Checks, if the instance is a valid one
[const]boolis_pcell?Returns a value indicating whether the instance is a PCell instance
[const]boolis_regular_array?Tests, if this instance is a regular array
[const]boolis_valid?Tests if the Instance object is still pointing to a valid instance
Layout ptrlayoutGets the layout this instance is contained in
[const]const Layout ptrlayoutGets the layout this instance is contained in
[const]unsigned longnaReturns the number of instances in the 'a' axis
voidna=(unsigned long na)Sets the number of instances in the 'a' axis
[const]unsigned longnbReturns the number of instances in the 'b' axis
voidnb=(unsigned long nb)Sets the number of instances in the 'b' axis
Cell ptrparent_cellGets the cell this instance is contained in
[const]const Cell ptrparent_cellGets the cell this instance is contained in
voidparent_cell=(Cell ptr new_parent)Moves the instance to a different cell
[const]const PCellDeclaration ptrpcell_declarationReturns the PCell declaration object
[const]variantpcell_parameter(string name)Gets a PCell parameter by the name of the parameter
[const]variant[]pcell_parametersGets the parameters of a PCell instance as a list of values
[const]map<string,variant>pcell_parameters_by_nameGets the parameters of a PCell instance as a dictionary of values vs. names
[const]unsigned longprop_idGets the properties ID associated with the instance
voidprop_id=(unsigned long id)Sets the properties ID associated with the instance
[const]variantpropertiesGets the user properties as a hash
[const]variantproperty(variant key)Gets the user property with the given key
voidset_property(variant key,
variant value)
Sets the user property with the given key to the given value
[const]unsigned longsizeGets the number of single instances in the instance array
[const]stringto_sCreates a string showing the contents of the reference
[const]stringto_s(bool with_cellname)Creates a string showing the contents of the reference
[const]TranstransGets the transformation of the instance or the first instance in the array
voidtrans=(const Trans t)Sets the transformation of the instance or the first instance in the array
voidtrans=(const DTrans t)Sets the transformation of the instance or the first instance in the array (in micrometer units)
voidtransform(const Trans t)Transforms the instance array with the given transformation
voidtransform(const ICplxTrans t)Transforms the instance array with the given complex transformation
voidtransform(const DTrans t)Transforms the instance array with the given transformation (given in micrometer units)
voidtransform(const DCplxTrans t)Transforms the instance array with the given complex transformation (given in micrometer units)
voidtransform_into(const Trans t)Transforms the instance array with the given transformation
voidtransform_into(const ICplxTrans t)Transforms the instance array with the given transformation
voidtransform_into(const DTrans t)Transforms the instance array with the given transformation (given in micrometer units)
voidtransform_into(const DCplxTrans t)Transforms the instance array with the given complex transformation (given in micrometer units)

Deprecated methods (protected, public, static, non-static and constructors)

[const]Boxbbox_per_layer(unsigned int layer_index)Use of this method is deprecated. Use bbox instead
voidcreateUse of this method is deprecated. Use _create instead
[const]DBoxdbbox_per_layer(unsigned int layer_index)Use of this method is deprecated. Use dbbox instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

!=

Signature: [const] bool != (const Instance b)

Description: Tests for inequality of two Instance objects

Warning: this operator returns true if both objects refer to the same instance, not just identical ones.

<

Signature: [const] bool < (const Instance b)

Description: Provides an order criterion for two Instance objects

Warning: this operator is just provided to establish any order, not a particular one.

==

Signature: [const] bool == (const Instance b)

Description: Tests for equality of two Instance objects

See the hint on the < operator.

[]

Signature: [const] variant [] (variant key)

Description: Gets the user property with the given key or, if available, the PCell parameter with the name given by the key

Getting the PCell parameter has priority over the user property. This method has been introduced in version 0.25.

[]=

Signature: void []= (variant key, variant value)

Description: Sets the user property with the given key or, if available, the PCell parameter with the name given by the key

Setting the PCell parameter has priority over the user property. This method has been introduced in version 0.25.

_const_cast

Signature: [const] Instance ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

a

Signature: [const] Vector a

Description: Returns the displacement vector for the 'a' axis

Starting with version 0.25 the displacement is of vector type.

Python specific notes:
The object exposes a readable attribute 'a'. This is the getter.

a=

(1) Signature: void a= (const Vector a)

Description: Sets the displacement vector for the 'a' axis

If the instance was not an array instance before it is made one.

This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type.

Python specific notes:
The object exposes a writable attribute 'a'. This is the setter.

(2) Signature: void a= (const DVector a)

Description: Sets the displacement vector for the 'a' axis in micrometer units

Like a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of DVector type. The vector will be translated to database units internally.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'a'. This is the setter.
The object exposes a writable attribute 'da'. This is the setter.

assign

Signature: void assign (const Instance other)

Description: Assigns another object to self

b

Signature: [const] Vector b

Description: Returns the displacement vector for the 'b' axis

Starting with version 0.25 the displacement is of vector type.

Python specific notes:
The object exposes a readable attribute 'b'. This is the getter.

b=

(1) Signature: void b= (const Vector b)

Description: Sets the displacement vector for the 'b' axis

If the instance was not an array instance before it is made one.

This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type.

Python specific notes:
The object exposes a writable attribute 'b'. This is the setter.

(2) Signature: void b= (const DVector b)

Description: Sets the displacement vector for the 'b' axis in micrometer units

Like b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of DVector type. The vector will be translated to database units internally.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'b'. This is the setter.
The object exposes a writable attribute 'db'. This is the setter.

bbox

(1) Signature: [const] Box bbox

Description: Gets the bounding box of the instance

The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array). This method has been introduced in version 0.23.

(2) Signature: [const] Box bbox (unsigned int layer_index)

Description: Gets the bounding box of the instance for a given layer

layer_index:The index of the layer the bounding box will be computed for.

The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all its children', an empty bounding box will be returned. This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28.

bbox_per_layer

Signature: [const] Box bbox_per_layer (unsigned int layer_index)

Description: Gets the bounding box of the instance for a given layer

layer_index:The index of the layer the bounding box will be computed for.

Use of this method is deprecated. Use bbox instead

The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all its children', an empty bounding box will be returned. This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28.

cell

(1) Signature: Cell ptr cell

Description: Gets the Cell object of the cell this instance refers to

Please note that before version 0.23 this method returned the cell the instance is contained in. For consistency, this method has been renamed parent_cell.

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a readable attribute 'cell'. This is the getter.

(2) Signature: [const] const Cell ptr cell

Description: Gets the Cell object of the cell this instance refers to

This is the const version of the cell method. It will return a const Cell object and itself can be called on a const Instance object.

This variant has been introduced in version 0.25.

Python specific notes:
This method is available as 'cell_' in Python to distiguish it from the property with the same name.

cell=

Signature: void cell= (const Cell ptr cell)

Description: Sets the Cell object this instance refers to

Setting the cell object to nil is equivalent to deleting the instance.

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'cell'. This is the setter.

cell_index

Signature: [const] unsigned int cell_index

Description: Get the index of the cell this instance refers to

Python specific notes:
The object exposes a readable attribute 'cell_index'. This is the getter.

cell_index=

Signature: void cell_index= (unsigned int cell_index)

Description: Sets the index of the cell this instance refers to

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'cell_index'. This is the setter.

cell_inst

Signature: [const] CellInstArray cell_inst

Description: Gets the basic CellInstArray object associated with this instance reference.

Python specific notes:
The object exposes a readable attribute 'cell_inst'. This is the getter.

cell_inst=

(1) Signature: void cell_inst= (const CellInstArray inst)

Description: Changes the CellInstArray object to the given one.

This method replaces the instance by the given CellInstArray object.

This method has been introduced in version 0.22

Python specific notes:
The object exposes a writable attribute 'cell_inst'. This is the setter.

(2) Signature: void cell_inst= (const DCellInstArray inst)

Description: Returns the basic cell instance array object by giving a micrometer unit object.

This method replaces the instance by the given CellInstArray object and it internally transformed into database units.

This method has been introduced in version 0.25

Python specific notes:
The object exposes a writable attribute 'cell_inst'. This is the setter.
The object exposes a writable attribute 'dcell_inst'. This is the setter.

change_pcell_parameter

Signature: void change_pcell_parameter (string name, variant value)

Description: Changes a single parameter of a PCell instance to the given value

This method changes a parameter of a PCell instance to the given value. The name identifies the PCell parameter and must correspond to one parameter listed in the PCell declaration.

This method has been introduced in version 0.24.

change_pcell_parameters

(1) Signature: void change_pcell_parameters (variant[] params)

Description: Changes the parameters of a PCell instance to the list of parameters

This method changes the parameters of a PCell instance to the given list of parameters. The list must correspond to the parameters listed in the pcell declaration. A more convenient method is provided with the same name which accepts a dictionary of names and values . This method has been introduced in version 0.24.

(2) Signature: void change_pcell_parameters (map<string,variant> dict)

Description: Changes the parameters of a PCell instance to the dictionary of parameters

This method changes the parameters of a PCell instance to the given values. The values are specifies as a dictionary of names (keys) vs. values. Unknown names are ignored and only the parameters listed in the dictionary are changed.

This method has been introduced in version 0.24.

convert_to_static

Signature: void convert_to_static

Description: Converts a PCell instance to a static cell

If the instance is a PCell instance, this method will convert the cell into a static cell and remove the PCell variant if required. A new cell will be created containing the PCell content but being a static cell. If the instance is not a PCell instance, this method won't do anything.

This method has been introduced in version 0.24.

cplx_trans

Signature: [const] ICplxTrans cplx_trans

Description: Gets the complex transformation of the instance or the first instance in the array

This method is always valid compared to trans, since simple transformations can be expressed as complex transformations as well.

Python specific notes:
The object exposes a readable attribute 'cplx_trans'. This is the getter.

cplx_trans=

(1) Signature: void cplx_trans= (const ICplxTrans t)

Description: Sets the complex transformation of the instance or the first instance in the array

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'cplx_trans'. This is the setter.

(2) Signature: void cplx_trans= (const DCplxTrans t)

Description: Sets the complex transformation of the instance or the first instance in the array (in micrometer units)

This method sets the transformation the same way as cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'cplx_trans'. This is the setter.
The object exposes a writable attribute 'dcplx_trans'. This is the setter.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

da

Signature: [const] DVector da

Description: Returns the displacement vector for the 'a' axis in micrometer units

Like a, this method returns the displacement, but it will be translated to database units internally.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a readable attribute 'da'. This is the getter.

da=

Signature: void da= (const DVector a)

Description: Sets the displacement vector for the 'a' axis in micrometer units

Like a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of DVector type. The vector will be translated to database units internally.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'a'. This is the setter.
The object exposes a writable attribute 'da'. This is the setter.

db

Signature: [const] DVector db

Description: Returns the displacement vector for the 'b' axis in micrometer units

Like b, this method returns the displacement, but it will be translated to database units internally.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a readable attribute 'db'. This is the getter.

db=

Signature: void db= (const DVector b)

Description: Sets the displacement vector for the 'b' axis in micrometer units

Like b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of DVector type. The vector will be translated to database units internally.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'b'. This is the setter.
The object exposes a writable attribute 'db'. This is the setter.

dbbox

(1) Signature: [const] DBox dbbox

Description: Gets the bounding box of the instance in micron units

Gets the bounding box (see bbox) of the instance, but will compute the micrometer unit box by multiplying bbox with the database unit.

This method has been introduced in version 0.25.

(2) Signature: [const] DBox dbbox (unsigned int layer_index)

Description: Gets the bounding box of the instance in micron units

layer_index:The index of the layer the bounding box will be computed for.

Gets the bounding box (see bbox) of the instance, but will compute the micrometer unit box by multiplying bbox with the database unit.

This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28.

dbbox_per_layer

Signature: [const] DBox dbbox_per_layer (unsigned int layer_index)

Description: Gets the bounding box of the instance in micron units

layer_index:The index of the layer the bounding box will be computed for.

Use of this method is deprecated. Use dbbox instead

Gets the bounding box (see bbox) of the instance, but will compute the micrometer unit box by multiplying bbox with the database unit.

This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28.

dcell_inst

Signature: DCellInstArray dcell_inst

Description: Returns the micrometer unit version of the basic cell instance array object.

This method has been introduced in version 0.25

Python specific notes:
The object exposes a readable attribute 'dcell_inst'. This is the getter.

dcell_inst=

Signature: void dcell_inst= (const DCellInstArray inst)

Description: Returns the basic cell instance array object by giving a micrometer unit object.

This method replaces the instance by the given CellInstArray object and it internally transformed into database units.

This method has been introduced in version 0.25

Python specific notes:
The object exposes a writable attribute 'cell_inst'. This is the setter.
The object exposes a writable attribute 'dcell_inst'. This is the setter.

dcplx_trans

Signature: [const] DCplxTrans dcplx_trans

Description: Gets the complex transformation of the instance or the first instance in the array (in micrometer units)

This method returns the same transformation as cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a readable attribute 'dcplx_trans'. This is the getter.

dcplx_trans=

Signature: void dcplx_trans= (const DCplxTrans t)

Description: Sets the complex transformation of the instance or the first instance in the array (in micrometer units)

This method sets the transformation the same way as cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'cplx_trans'. This is the setter.
The object exposes a writable attribute 'dcplx_trans'. This is the setter.

delete

Signature: void delete

Description: Deletes this instance

After this method was called, the instance object is pointing to nothing.

This method has been introduced in version 0.23.

delete_property

Signature: void delete_property (variant key)

Description: Deletes the user property with the given key

This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances.

This method has been introduced in version 0.22.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dtrans

Signature: [const] DTrans dtrans

Description: Gets the transformation of the instance or the first instance in the array (in micrometer units)

This method returns the same transformation as cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a readable attribute 'dtrans'. This is the getter.

dtrans=

Signature: void dtrans= (const DTrans t)

Description: Sets the transformation of the instance or the first instance in the array (in micrometer units)

This method sets the transformation the same way as cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'trans'. This is the setter.
The object exposes a writable attribute 'dtrans'. This is the setter.

dup

Signature: [const] new Instance ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

explode

Signature: void explode

Description: Explodes the instance array

This method does nothing if the instance was not an array before. The instance object will point to the first instance of the array afterwards.

This method has been introduced in version 0.23.

flatten

(1) Signature: void flatten

Description: Flattens the instance

This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. There is another variant of this method which allows specification of the number of hierarchy levels to flatten.

This method has been introduced in version 0.24.

(2) Signature: void flatten (int levels)

Description: Flattens the instance

This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. This version of the method allows specification of the number of hierarchy levels to remove. Specifying 1 for 'levels' will remove the instance and replace it by the contents of the cell. Specifying a negative value or zero for the number of levels will flatten the instance completely.

This method has been introduced in version 0.24.

has_prop_id?

Signature: [const] bool has_prop_id?

Description: Returns true, if the instance has properties

is_complex?

Signature: [const] bool is_complex?

Description: Tests, if the array is a complex array

Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles).

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

is_null?

Signature: [const] bool is_null?

Description: Checks, if the instance is a valid one

is_pcell?

Signature: [const] bool is_pcell?

Description: Returns a value indicating whether the instance is a PCell instance

This method has been introduced in version 0.24.

is_regular_array?

Signature: [const] bool is_regular_array?

Description: Tests, if this instance is a regular array

is_valid?

Signature: [const] bool is_valid?

Description: Tests if the Instance object is still pointing to a valid instance

If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again.

This method has been introduced in version 0.23 and is a shortcut for "inst.cell.is_valid?(inst)".

layout

(1) Signature: Layout ptr layout

Description: Gets the layout this instance is contained in

This method has been introduced in version 0.22.

(2) Signature: [const] const Layout ptr layout

Description: Gets the layout this instance is contained in

This const version of the method has been introduced in version 0.25.

na

Signature: [const] unsigned long na

Description: Returns the number of instances in the 'a' axis

Python specific notes:
The object exposes a readable attribute 'na'. This is the getter.

na=

Signature: void na= (unsigned long na)

Description: Sets the number of instances in the 'a' axis

If the instance was not an array instance before it is made one.

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'na'. This is the setter.

nb

Signature: [const] unsigned long nb

Description: Returns the number of instances in the 'b' axis

Python specific notes:
The object exposes a readable attribute 'nb'. This is the getter.

nb=

Signature: void nb= (unsigned long nb)

Description: Sets the number of instances in the 'b' axis

If the instance was not an array instance before it is made one.

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'nb'. This is the setter.

new

Signature: [static] new Instance ptr new

Description: Creates a new object of this class

Python specific notes:
This method is the default initializer of the object.

parent_cell

(1) Signature: Cell ptr parent_cell

Description: Gets the cell this instance is contained in

Returns nil if the instance does not live inside a cell. This method was named "cell" previously which lead to confusion with cell_index. It was renamed to "parent_cell" in version 0.23.

Python specific notes:
The object exposes a readable attribute 'parent_cell'. This is the getter.

(2) Signature: [const] const Cell ptr parent_cell

Description: Gets the cell this instance is contained in

Returns nil if the instance does not live inside a cell.

This const version of the parent_cell method has been introduced in version 0.25.

Python specific notes:
This method is available as 'parent_cell_' in Python to distiguish it from the property with the same name.

parent_cell=

Signature: void parent_cell= (Cell ptr new_parent)

Description: Moves the instance to a different cell

Both the current and the target cell must live in the same layout.

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'parent_cell'. This is the setter.

pcell_declaration

Signature: [const] const PCellDeclaration ptr pcell_declaration

Description: Returns the PCell declaration object

If the instance is a PCell instance, this method returns the PCell declaration object for that PCell. If not, this method will return nil. This method has been introduced in version 0.24.

pcell_parameter

Signature: [const] variant pcell_parameter (string name)

Description: Gets a PCell parameter by the name of the parameter

Returns:The parameter value or nil if the instance is not a PCell or does not have a parameter with given name

This method has been introduced in version 0.25.

pcell_parameters

Signature: [const] variant[] pcell_parameters

Description: Gets the parameters of a PCell instance as a list of values

Returns:A list of values

If the instance is a PCell instance, this method will return an array of values where each value corresponds to one parameter. The order of the values is the order the parameters are declared in the PCell declaration. If the instance is not a PCell instance, this list returned will be empty.

This method has been introduced in version 0.24.

pcell_parameters_by_name

Signature: [const] map<string,variant> pcell_parameters_by_name

Description: Gets the parameters of a PCell instance as a dictionary of values vs. names

Returns:A dictionary of values by parameter name

If the instance is a PCell instance, this method will return a map of values vs. parameter names. The names are the ones defined in the PCell declaration.If the instance is not a PCell instance, the dictionary returned will be empty.

This method has been introduced in version 0.24.

prop_id

Signature: [const] unsigned long prop_id

Description: Gets the properties ID associated with the instance

Python specific notes:
The object exposes a readable attribute 'prop_id'. This is the getter.

prop_id=

Signature: void prop_id= (unsigned long id)

Description: Sets the properties ID associated with the instance

This method is provided, if a properties ID has been derived already. Usually it's more convenient to use delete_property, set_property or property.

This method has been introduced in version 0.22.

Python specific notes:
The object exposes a writable attribute 'prop_id'. This is the setter.

properties

Signature: [const] variant properties

Description: Gets the user properties as a hash

This method is a convenience method that gets all user properties as a single hash.

This method has been introduced in version 0.29.5.

property

Signature: [const] variant property (variant key)

Description: Gets the user property with the given key

This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. This method has been introduced in version 0.22.

set_property

Signature: void set_property (variant key, variant value)

Description: Sets the user property with the given key to the given value

This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances.

This method has been introduced in version 0.22.

size

Signature: [const] unsigned long size

Description: Gets the number of single instances in the instance array

If the instance represents a single instance, the count is 1. Otherwise it is na*nb.

Python specific notes:
This method is also available as 'len(object)'.

to_s

(1) Signature: [const] string to_s

Description: Creates a string showing the contents of the reference

This method has been introduced with version 0.16.

Python specific notes:
This method is also available as 'str(object)'.

(2) Signature: [const] string to_s (bool with_cellname)

Description: Creates a string showing the contents of the reference

Passing true to with_cellname makes the string contain the cellname instead of the cell index

This method has been introduced with version 0.23.

trans

Signature: [const] Trans trans

Description: Gets the transformation of the instance or the first instance in the array

The transformation returned is only valid if the array does not represent a complex transformation array

Python specific notes:
The object exposes a readable attribute 'trans'. This is the getter.

trans=

(1) Signature: void trans= (const Trans t)

Description: Sets the transformation of the instance or the first instance in the array

This method has been introduced in version 0.23.

Python specific notes:
The object exposes a writable attribute 'trans'. This is the setter.

(2) Signature: void trans= (const DTrans t)

Description: Sets the transformation of the instance or the first instance in the array (in micrometer units)

This method sets the transformation the same way as cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.

This method has been introduced in version 0.25.

Python specific notes:
The object exposes a writable attribute 'trans'. This is the setter.
The object exposes a writable attribute 'dtrans'. This is the setter.

transform

(1) Signature: void transform (const Trans t)

Description: Transforms the instance array with the given transformation

See Cell#transform for a description of this method.

This method has been introduced in version 0.23.

(2) Signature: void transform (const ICplxTrans t)

Description: Transforms the instance array with the given complex transformation

See Cell#transform for a description of this method.

This method has been introduced in version 0.23.

(3) Signature: void transform (const DTrans t)

Description: Transforms the instance array with the given transformation (given in micrometer units)

Transforms the instance like transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units.

This method has been introduced in version 0.25.

(4) Signature: void transform (const DCplxTrans t)

Description: Transforms the instance array with the given complex transformation (given in micrometer units)

Transforms the instance like transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units.

This method has been introduced in version 0.25.

transform_into

(1) Signature: void transform_into (const Trans t)

Description: Transforms the instance array with the given transformation

See Cell#transform_into for a description of this method.

This method has been introduced in version 0.23.

(2) Signature: void transform_into (const ICplxTrans t)

Description: Transforms the instance array with the given transformation

See Cell#transform_into for a description of this method.

This method has been introduced in version 0.23.

(3) Signature: void transform_into (const DTrans t)

Description: Transforms the instance array with the given transformation (given in micrometer units)

Transforms the instance like transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units.

This method has been introduced in version 0.25.

(4) Signature: void transform_into (const DCplxTrans t)

Description: Transforms the instance array with the given complex transformation (given in micrometer units)

Transforms the instance like transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units.

This method has been introduced in version 0.25.