API reference - Class Layout

Notation used in Ruby API documentation

Description: The layout object

This object represents a layout. The layout object contains the cell hierarchy and adds functionality for managing cell names and layer names. The cell hierarchy can be changed by adding cells and cell instances. Cell instances will virtually put the content of a cell into another cell. Many cell instances can be put into a cell thus forming repetitions of the cell content. This process can be repeated over multiple levels. In effect a cell graphs is created with parent cells and child cells. The graph must not be recursive, so there is at least one top cell, which does not have a parent cell. Multiple top cells can be present.

Layout is the very basic class of the layout database. It has a rich set of methods to manipulate and query the layout hierarchy, the geometrical objects, the meta information and other features of the layout database. For a discussion of the basic API and the related classes see The Database API.

Usually layout objects have already been created by KLayout's application core. You can address such a layout via the CellView object inside the LayoutView class. For example:

active_layout = RBA::CellView::active.layout
puts "Top cell of current layout is #{active_layout.top_cell.name}"

However, a layout can also be used standalone:

layout = RBA::Layout::new
cell = layout.create_cell("TOP")
layer = layout.layer(RBA::LayerInfo::new(1, 0))
cell.shapes(layer).insert(RBA::Box::new(0, 0, 1000, 1000))
layout.write("single_rect.gds")

Public constructors

new Layout ptrnew(Manager manager)Creates a layout object attached to a manager
new Layout ptrnewCreates a layout object
new Layout ptrnew(bool editable,
Manager manager)
Creates a layout object attached to a manager
new Layout ptrnew(bool editable)Creates a layout object

Public methods

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.
unsigned intadd_lib_cell(Library ptr library,
unsigned int lib_cell_index)
Imports a cell from the library
voidadd_meta_info(const LayoutMetaInfo info)Adds meta information to the layout
unsigned intadd_pcell_variant(unsigned long pcell_id,
map<string,variant> parameters)
Creates a PCell variant for the given PCell ID with the parameters given as a name/value dictionary
unsigned intadd_pcell_variant(unsigned long pcell_id,
variant[] parameters)
Creates a PCell variant for the given PCell ID with the given parameters
unsigned intadd_pcell_variant(Library ptr library,
unsigned long pcell_id,
map<string,variant> parameters)
Creates a PCell variant for a PCell located in an external library with the parameters given as a name/value dictionary
unsigned intadd_pcell_variant(Library ptr library,
unsigned long pcell_id,
variant[] parameters)
Creates a PCell variant for a PCell located in an external library
voidassign(const Layout other)Assigns another object to self
[const]RecursiveShapeIteratorbegin_shapes(const Cell ptr cell,
unsigned int layer)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer
[const]RecursiveShapeIteratorbegin_shapes(unsigned int cell_index,
unsigned int layer)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer
[const]RecursiveShapeIteratorbegin_shapes_overlapping(unsigned int cell_index,
unsigned int layer,
Box region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search
[const]RecursiveShapeIteratorbegin_shapes_overlapping(const Cell ptr cell_index,
unsigned int layer,
Box region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search
[const]RecursiveShapeIteratorbegin_shapes_overlapping(unsigned int cell_index,
unsigned int layer,
DBox region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units
[const]RecursiveShapeIteratorbegin_shapes_overlapping(const Cell ptr cell,
unsigned int layer,
DBox region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units
[const]RecursiveShapeIteratorbegin_shapes_touching(unsigned int cell_index,
unsigned int layer,
Box region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search
[const]RecursiveShapeIteratorbegin_shapes_touching(const Cell ptr cell,
unsigned int layer,
Box region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search
[const]RecursiveShapeIteratorbegin_shapes_touching(unsigned int cell_index,
unsigned int layer,
DBox region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units
[const]RecursiveShapeIteratorbegin_shapes_touching(const Cell ptr cell,
unsigned int layer,
DBox region)
Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units
Cell ptrcell(string name)Gets a cell object from the cell name
Cell ptrcell(unsigned int i)Gets a cell object from the cell index
[const]stringcell_name(unsigned int index)Gets the name for a cell with the given index
[const]unsigned intcellsReturns the number of cells
voidcleanupCleans up the layout
voidclearClears the layout
voidclear_layer(unsigned int layer_index)Clears a layer
unsigned intclip(unsigned int cell,
const Box box)
Clips the given cell by the given rectangle and produce a new cell with the clip
[const]unsigned intclip_into(unsigned int cell,
Layout ptr target,
const Box box)
Clips the given cell by the given rectangle and produce a new cell with the clip
unsigned intconvert_cell_to_static(unsigned int cell_index)Converts a PCell or library cell to a usual (static) cell
voidcopy_layer(unsigned int src,
unsigned int dest)
Copies a layer
Cell ptrcreate_cell(string name)Creates a cell with the given name
Cell ptrcreate_cell(string name,
map<string,variant> params)
Creates a cell as a PCell variant with the given name
Cell ptrcreate_cell(string name,
string lib_name)
Creates a cell with the given name
Cell ptrcreate_cell(string name,
string lib_name,
map<string,variant> params)
Creates a cell with the given name
[const]doubledbuGets the database unit
voiddbu=(double dbu)Sets the database unit
voiddelete_cell(unsigned int cell_index)Deletes a cell
voiddelete_cell_rec(unsigned int cell_index)Deletes a cell plus all subcells
voiddelete_cells(unsigned int[] cell_index_list)Deletes multiple cells
voiddelete_layer(unsigned int layer_index)Deletes a layer
voiddelete_property(variant key)Deletes the user property with the given key
[const]new Layout ptrdupCreates a copy of self
[iter]Celleach_cellIterates the unsorted cell list
[iter]unsigned inteach_cell_bottom_upIterates the bottom-up sorted cell list
[iter]unsigned inteach_cell_top_downbegin iterator of the top-down sorted cell list
[const,iter]LayoutMetaInfoeach_meta_infoIterates over the meta information of the layout
[iter]unsigned inteach_top_cellIterates the top cells
voidend_changesCancels the "in changes" state (see "start_changes")
variantfind_layer(const LayerInfo info)Finds a layer with the given properties
variantfind_layer(string name)Finds a layer with the given name
variantfind_layer(int layer,
int datatype)
Finds a layer with the given layer and datatype number
variantfind_layer(int layer,
int datatype,
string name)
Finds a layer with the given layer and datatype number and name
voidflatten(unsigned int cell_index,
int levels,
bool prune)
Flattens the given cell
voidflatten_into(unsigned int source_cell_index,
unsigned int target_cell_index,
const ICplxTrans trans,
int levels)
Flattens the given cell into another cell
[const]LayerInfoget_info(unsigned int index)Gets the info structure for a specified layer
[const]unsigned intguiding_shape_layerReturns the index of the guiding shape layer
boolhas_cell?(string name)Returns true if a cell with a given name exists
[const]boolhas_prop_id?Returns true, if the layout has user properties
unsigned intinsert_layer(const LayerInfo props)Inserts a new layer with the given properties
voidinsert_layer_at(unsigned int index,
const LayerInfo props)
Inserts a new layer with the given properties at the given index
unsigned intinsert_special_layer(const LayerInfo props)Inserts a new special layer with the given properties
voidinsert_special_layer_at(unsigned int index,
const LayerInfo props)
Inserts a new special layer with the given properties at the given index
[const]boolis_editable?Returns a value indicating whether the layout is editable.
[const]boolis_special_layer?(unsigned int layer_index)Returns true, if a layer index is a special layer index
[const]boolis_valid_cell_index?(unsigned int cell_index)Returns true, if a cell index is a valid index
[const]boolis_valid_layer?(unsigned int layer_index)Returns true, if a layer index is a valid index
unsigned intlayerCreates a new internal layer
unsigned intlayer(const LayerInfo info)Finds or creates a layer with the given properties
unsigned intlayer(string name)Finds or creates a layer with the given name
unsigned intlayer(int layer,
int datatype)
Finds or creates a layer with the given layer and datatype number
unsigned intlayer(int layer,
int datatype,
string name)
Finds or creates a layer with the given layer and datatype number and name
[const]unsigned int[]layer_indexesGets a list of valid layer's indices
[const]LayerInfo[]layer_infosGets a list of valid layer's properties
[const]unsigned intlayersReturns the number of layers
[const]stringmeta_info_value(string name)Gets the meta information value for a given name
voidmove_layer(unsigned int src,
unsigned int dest)
Moves a layer
unsigned int[]multi_clip(unsigned int cell,
Box[] boxes)
Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle.
unsigned int[]multi_clip_into(unsigned int cell,
Layout ptr target,
Box[] boxes)
Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle.
[const]const PCellDeclaration ptrpcell_declaration(string name)Gets a reference to the PCell declaration for the PCell with the given name
[const]const PCellDeclaration ptrpcell_declaration(unsigned long pcell_id)Gets a reference to the PCell declaration for the PCell with the given PCell ID.
[const]unsigned longpcell_id(string name)Gets the ID of the PCell with the given name
[const]unsigned long[]pcell_idsGets the IDs of the PCells registered in the layout
[const]string[]pcell_namesGets the names of the PCells registered in the layout
[const]unsigned longprop_idGets the properties ID associated with the layout
voidprop_id=(unsigned long id)Sets the properties ID associated with the layout
[const]variant[]properties(unsigned long properties_id)Gets the properties set for a given properties ID
unsigned longproperties_id(variant[] properties)Gets the properties ID for a given properties set
variantproperty(variant key)Gets the user property with the given key
voidprune_cell(unsigned int cell_index,
int levels)
Deletes a cell plus subcells not used otherwise
voidprune_subcells(unsigned int cell_index,
int levels)
Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy
LayerMapread(string filename)Load the layout from the given file
LayerMapread(string filename,
const LoadLayoutOptions options)
Load the layout from the given file with options
unsigned longregister_pcell(string name,
PCellDeclaration ptr declaration)
Registers a PCell declaration under the given name
voidremove_meta_info(string name)Removes meta information from the layout
voidrename_cell(unsigned int index,
string name)
name
voidset_info(unsigned int index,
const LayerInfo props)
Sets the info structure for a specified layer
voidset_property(variant key,
variant value)
Set the user property with the given key to the given value
voidstart_changesSignals the start of an operation bringing the layout into invalid state
voidswap_layers(unsigned int a,
unsigned int b)
Swap two layers
Cell ptrtop_cellReturns the top cell object
Cell ptr[]top_cellsReturns the top cell objects
voidtransform(const Trans trans)Transforms the layout with the given transformation
voidtransform(const ICplxTrans trans)Transforms the layout with the given complex integer transformation
voidtransform(const DTrans trans)Transforms the layout with the given transformation, which is in micrometer units
voidtransform(const DCplxTrans trans)Transforms the layout with the given complex integer transformation, which is in micrometer units
[const]boolunder_construction?Returns true if the layout object is under construction
voidupdateUpdates the internals of the layout
voidwrite(string filename,
const SaveLayoutOptions options)
Writes the layout to a stream file
voidwrite(string filename)Writes the layout to a stream file

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

unsigned intadd_cell(string name)Use of this method is deprecated
unsigned intcell_by_name(string name)Use of this method is deprecated
voidcreateUse of this method is deprecated. Use _create 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
[const]unsigned int[]layer_indicesUse of this method is deprecated. Use layer_indexes instead
voidwrite(string filename,
bool gzip,
const SaveLayoutOptions options)
Use of this method is deprecated

Detailed description

_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.

add_cell

Signature: unsigned int add_cell (string name)

Description: Adds a cell with the given name

Returns:The index of the newly created cell.

Use of this method is deprecated

add_lib_cell

Signature: unsigned int add_lib_cell (Library ptr library,unsigned int lib_cell_index)

Description: Imports a cell from the library

library:The reference to the library from which to import the cell
lib_cell_index:The index of the imported cell in the library
Returns:The cell index of the new proxy cell in this layout

This method imports the given cell from the library and creates a new proxy cell. The proxy cell acts as a pointer to the actual cell which still resides in the library (precisely: in library.layout). The name of the new cell will be the name of library cell.

This method has been introduced in version 0.22.

add_meta_info

Signature: void add_meta_info (const LayoutMetaInfo info)

Description: Adds meta information to the layout

See LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.25.

add_pcell_variant

Signature: unsigned int add_pcell_variant (unsigned long pcell_id,map<string,variant> parameters)

Description: Creates a PCell variant for the given PCell ID with the parameters given as a name/value dictionary

Returns:The cell index of the pcell variant proxy cell

This method will create a PCell variant proxy for a local PCell definition. It will create the PCell variant for the given parameters. Note that this method does not allow to create PCell instances for PCell's located in a library. Use add_pcell_variant with the library parameter for that purpose. Unlike the variant using a list of parameters, this version allows specification of the parameters with a key/value dictionary. The keys are the parameter names as given by the PCell declaration.

The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object.

The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated.

This method has been introduced in version 0.22.

Signature: unsigned int add_pcell_variant (unsigned long pcell_id,variant[] parameters)

Description: Creates a PCell variant for the given PCell ID with the given parameters

Returns:The cell index of the pcell variant proxy cell

This method will create a PCell variant proxy for a local PCell definition. It will create the PCell variant for the given parameters. Note that this method does not allow to create PCell instances for PCell's located in a library. Use add_pcell_variant with the library parameter for that purpose.

The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object.

The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated.

This method has been introduced in version 0.22.

Signature: unsigned int add_pcell_variant (Library ptr library,unsigned long pcell_id,map<string,variant> parameters)

Description: Creates a PCell variant for a PCell located in an external library with the parameters given as a name/value dictionary

Returns:The cell index of the new proxy cell in this layout

This method will import a PCell from a library and create a variant for the given parameter set. Technically, this method creates a proxy to the library and creates the variant inside that library. Unlike the variant using a list of parameters, this version allows specification of the parameters with a key/value dictionary. The keys are the parameter names as given by the PCell declaration.

The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object.

The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated.

This method has been introduced in version 0.22.

Signature: unsigned int add_pcell_variant (Library ptr library,unsigned long pcell_id,variant[] parameters)

Description: Creates a PCell variant for a PCell located in an external library

Returns:The cell index of the new proxy cell in this layout

This method will import a PCell from a library and create a variant for the given parameter set. Technically, this method creates a proxy to the library and creates the variant inside that library.

The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object.

The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated.

This method has been introduced in version 0.22.

assign

Signature: void assign (const Layout other)

Description: Assigns another object to self

begin_shapes

Signature: [const] RecursiveShapeIterator begin_shapes (const Cell ptr cell,unsigned int layer)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer

cell:The cell object of the initial (top) cell
layer:The layer from which to get the shapes
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version is convenience overload which takes a cell object instead of a cell index.

This method has been added in version 0.24.

Signature: [const] RecursiveShapeIterator begin_shapes (unsigned int cell_index,unsigned int layer)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer

cell_index:The index of the initial (top) cell
layer:The layer from which to get the shapes
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class.

This method has been added in version 0.18.

begin_shapes_overlapping

Signature: [const] RecursiveShapeIterator begin_shapes_overlapping (unsigned int cell_index,unsigned int layer,Box region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search

cell_index:The index of the starting cell
layer:The layer from which to get the shapes
region:The search region
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region.

This method has been added in version 0.18.

Signature: [const] RecursiveShapeIterator begin_shapes_overlapping (const Cell ptr cell_index,unsigned int layer,Box region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search

cell:The cell object for the starting cell
layer:The layer from which to get the shapes
region:The search region
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region. It is convenience overload which takes a cell object instead of a cell index.

This method has been added in version 0.24.

Signature: [const] RecursiveShapeIterator begin_shapes_overlapping (unsigned int cell_index,unsigned int layer,DBox region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units

cell_index:The index of the starting cell
layer:The layer from which to get the shapes
region:The search region as a DBox object in micrometer units
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region.

This variant has been added in version 0.25.

Signature: [const] RecursiveShapeIterator begin_shapes_overlapping (const Cell ptr cell,unsigned int layer,DBox region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units

cell:The cell object for the starting cell
layer:The layer from which to get the shapes
region:The search region as a DBox object in micrometer units
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region. It is convenience overload which takes a cell object instead of a cell index.

This variant has been added in version 0.25.

begin_shapes_touching

Signature: [const] RecursiveShapeIterator begin_shapes_touching (unsigned int cell_index,unsigned int layer,Box region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search

cell_index:The index of the starting cell
layer:The layer from which to get the shapes
region:The search region
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region.

This method has been added in version 0.18.

Signature: [const] RecursiveShapeIterator begin_shapes_touching (const Cell ptr cell,unsigned int layer,Box region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search

cell:The cell object for the starting cell
layer:The layer from which to get the shapes
region:The search region
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region. It is convenience overload which takes a cell object instead of a cell index.

This method has been added in version 0.24.

Signature: [const] RecursiveShapeIterator begin_shapes_touching (unsigned int cell_index,unsigned int layer,DBox region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units

cell_index:The index of the starting cell
layer:The layer from which to get the shapes
region:The search region as a DBox object in micrometer units
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region.

This variant has been added in version 0.25.

Signature: [const] RecursiveShapeIterator begin_shapes_touching (const Cell ptr cell,unsigned int layer,DBox region)

Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units

cell:The cell object for the starting cell
layer:The layer from which to get the shapes
region:The search region as a DBox object in micrometer units
Returns:A suitable iterator

For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region. It is convenience overload which takes a cell object instead of a cell index.

This variant has been added in version 0.25.

cell

Signature: Cell ptr cell (string name)

Description: Gets a cell object from the cell name

name:The cell name
Returns:A reference to the cell (a Cell object)

If name is not a valid cell name, this method will return "nil". This method has been introduced in version 0.23 and replaces cell_by_name.

Signature: Cell ptr cell (unsigned int i)

Description: Gets a cell object from the cell index

i:The cell index
Returns:A reference to the cell (a Cell object)

If the cell index is not a valid cell index, this method will raise an error. Use is_valid_cell_index? to test whether a given cell index is valid.

cell_by_name

Signature: unsigned int cell_by_name (string name)

Description: Gets the cell index for a given name

Use of this method is deprecated

cell_name

Signature: [const] string cell_name (unsigned int index)

Description: Gets the name for a cell with the given index

cells

Signature: [const] unsigned int cells

Description: Returns the number of cells

Returns:The number of cells (the maximum cell index)

cleanup

Signature: void cleanup

Description: Cleans up the layout

This method will remove proxy objects that are no longer in use. After changing PCell parameters such proxy objects may still be present in the layout and are cached for later reuse. Usually they are cleaned up automatically occasionally, but in a scripting context it may be useful to clean up these cells explicitly.

This method has been introduced in version 0.25.

clear

Signature: void clear

Description: Clears the layout

Clears the layout completely.

clear_layer

Signature: void clear_layer (unsigned int layer_index)

Description: Clears a layer

layer_index:The index of the layer to delete.

Clears the layer: removes all shapes.

This method was introduced in version 0.19.

clip

Signature: unsigned int clip (unsigned int cell,const Box box)

Description: Clips the given cell by the given rectangle and produce a new cell with the clip

cell:The cell index of the cell to clip
box:The clip box in database units
Returns:The index of the new cell

This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell whose index is returned. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This method has been added in version 0.21.

clip_into

Signature: [const] unsigned int clip_into (unsigned int cell,Layout ptr target,const Box box)

Description: Clips the given cell by the given rectangle and produce a new cell with the clip

cell:The cell index of the cell to clip
box:The clip box in database units
target:The target layout
Returns:The index of the new cell in the target layout

This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell in the target layout. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell.

Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results.This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. This method has been added in version 0.21.

convert_cell_to_static

Signature: unsigned int convert_cell_to_static (unsigned int cell_index)

Description: Converts a PCell or library cell to a usual (static) cell

Returns:The index of the new cell

This method will create a new cell which contains the static representation of the PCell or library proxy given by "cell_index". If that cell is not a PCell or library proxy, it won't be touched and the input cell index is returned.

This method has been added in version 0.23.

copy_layer

Signature: void copy_layer (unsigned int src,unsigned int dest)

Description: Copies a layer

src:The layer index of the source layer.
dest:The layer index of the destination layer.

This method was introduced in version 0.19.

Copy a layer from the source to the target. The target is not cleared before, so that this method merges shapes from the source with the target layer.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

create_cell

Signature: Cell ptr create_cell (string name)

Description: Creates a cell with the given name

name:The name of the cell to create
Returns:The Cell object of the newly created cell.

If a cell with that name already exists, the unique name will be chosen for the new cell consisting of the given name plus a suitable suffix.

This method has been introduce in version 0.23 and replaces add_cell.

Signature: Cell ptr create_cell (string name,map<string,variant> params)

Description: Creates a cell as a PCell variant with the given name

name:The name of the PCell and the name of the cell to create
params:The PCell parameters (key/value dictionary)
Returns:The Cell object of the newly created cell.

This method will look up the PCell by the given name and create a new PCell variant with the given parameters. The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration.

If no PCell with the given name exists, nil is returned.

This method has been introduce in version 0.24.

Signature: Cell ptr create_cell (string name,string lib_name)

Description: Creates a cell with the given name

name:The name of the library cell and the name of the cell to create
lib_name:The name of the library where to take the cell from
Returns:The Cell object of the newly created cell.

This method will look up the cell by the given name in the specified library and create a new library proxy to this cell. If the library name is not valid, nil is returned.

This method has been introduce in version 0.24.

Signature: Cell ptr create_cell (string name,string lib_name,map<string,variant> params)

Description: Creates a cell with the given name

name:The name of the PCell and the name of the cell to create
lib_name:The name of the library where to take the PCell from
params:The PCell parameters (key/value dictionary)
Returns:The Cell object of the newly created cell.

This method will look up the PCell by the given name in the specified library and create a new PCell variant with the given parameters. The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration.

If no PCell with the given name exists or the library name is not valid, nil is returned.

This method has been introduce in version 0.24.

dbu

Signature: [const] double dbu

Description: Gets the database unit

The database unit is the value of one units distance in micrometers. For numerical reasons and to be compliant with the GDS2 format, the database objects use integer coordinates. The basic unit of these coordinates is the database unit. You can convert coordinates to micrometers by multiplying the integer value with the database unit. Typical values for the database unit are 0.001 micrometer (one nanometer).

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

dbu=

Signature: void dbu= (double dbu)

Description: Sets the database unit

See dbu for a description of the database unit.

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

delete_cell

Signature: void delete_cell (unsigned int cell_index)

Description: Deletes a cell

cell_index:The index of the cell to delete

This deletes a cell but not the sub cells of the cell. These subcells will likely become new top cells unless they are used otherwise. All instances of this cell are deleted as well. Hint: to delete multiple cells, use "delete_cells" which is far more efficient in this case.

This method has been introduced in version 0.20.

delete_cell_rec

Signature: void delete_cell_rec (unsigned int cell_index)

Description: Deletes a cell plus all subcells

cell_index:The index of the cell to delete

This deletes a cell and also all sub cells of the cell. In contrast to prune_cell, all cells are deleted together with their instances even if they are used otherwise.

This method has been introduced in version 0.20.

delete_cells

Signature: void delete_cells (unsigned int[] cell_index_list)

Description: Deletes multiple cells

cell_index_list:An array of cell indices of the cells to delete

This deletes the cells but not the sub cells of these cells. These subcells will likely become new top cells unless they are used otherwise. All instances of these cells are deleted as well.

This method has been introduced in version 0.20.

delete_layer

Signature: void delete_layer (unsigned int layer_index)

Description: Deletes a layer

layer_index:The index of the layer to delete.

This method frees the memory allocated for the shapes of this layer and remembers the layer's index for reuse when the next layer is allocated.

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.

This method has been introduced in version 0.24.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

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

dup

Signature: [const] new Layout ptr dup

Description: Creates a copy of self

each_cell

Signature: [iter] Cell each_cell

Description: Iterates the unsorted cell list

each_cell_bottom_up

Signature: [iter] unsigned int each_cell_bottom_up

Description: Iterates the bottom-up sorted cell list

In bottom-up traversal a cell is not delivered before the last child cell of this cell has been delivered. The bottom-up iterator does not deliver cells but cell indices actually.

each_cell_top_down

Signature: [iter] unsigned int each_cell_top_down

Description: begin iterator of the top-down sorted cell list

The top-down cell list has the property of delivering all cells before they are instantiated. In addition the first cells are all top cells. There is at least one top cell. The top-down iterator does not deliver cells but cell indices actually.

each_meta_info

Signature: [const,iter] LayoutMetaInfo each_meta_info

Description: Iterates over the meta information of the layout

See LayoutMetaInfo for details about layouts and meta information.

This method has been introduced in version 0.25.

each_top_cell

Signature: [iter] unsigned int each_top_cell

Description: Iterates the top cells

A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell.

end_changes

Signature: void end_changes

Description: Cancels the "in changes" state (see "start_changes")

find_layer

Signature: variant find_layer (const LayerInfo info)

Description: Finds a layer with the given properties

If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, it will return nil.

This method has been introduced in version 0.23.

Signature: variant find_layer (string name)

Description: Finds a layer with the given name

If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, it will return nil.

This method has been introduced in version 0.23.

Signature: variant find_layer (int layer,int datatype)

Description: Finds a layer with the given layer and datatype number

If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, it will return nil.

This method has been introduced in version 0.23.

Signature: variant find_layer (int layer,int datatype,string name)

Description: Finds a layer with the given layer and datatype number and name

If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, it will return nil.

This method has been introduced in version 0.23.

flatten

Signature: void flatten (unsigned int cell_index,int levels,bool prune)

Description: Flattens the given cell

cell_index:The cell which should be flattened
levels:The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.)
prune:Set to true to remove orphan cells.

This method propagates all shapes and instances from the specified number of hierarchy levels below into the given cell. It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. If prune is set to true, these cells are removed if not used otherwise.

This method has been introduced in version 0.20.

flatten_into

Signature: void flatten_into (unsigned int source_cell_index,unsigned int target_cell_index,const ICplxTrans trans,int levels)

Description: Flattens the given cell into another cell

source_cell_index:The source cell which should be flattened
target_cell_index:The target cell into which the resulting objects are written
trans:The transformation to apply on the output shapes and instances
levels:The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.)

This method works like 'flatten', but allows specification of a target cell which can be different from the source cell plus a transformation which is applied for all shapes and instances in the target cell.

In contrast to the 'flatten' method, the source cell is not modified.

This method has been introduced in version 0.24.

get_info

Signature: [const] LayerInfo get_info (unsigned int index)

Description: Gets the info structure for a specified layer

guiding_shape_layer

Signature: [const] unsigned int guiding_shape_layer

Description: Returns the index of the guiding shape layer

The guiding shape layer is used to store guiding shapes for PCells.

This method has been added in version 0.22.

has_cell?

Signature: bool has_cell? (string name)

Description: Returns true if a cell with a given name exists

Returns true, if the layout has a cell with the given name

has_prop_id?

Signature: [const] bool has_prop_id?

Description: Returns true, if the layout has user properties

This method has been introduced in version 0.24.

insert_layer

Signature: unsigned int insert_layer (const LayerInfo props)

Description: Inserts a new layer with the given properties

Returns:The index of the newly created layer

insert_layer_at

Signature: void insert_layer_at (unsigned int index,const LayerInfo props)

Description: Inserts a new layer with the given properties at the given index

This method will associate the given layer info with the given layer index. If a layer with that index already exists, this method will change the properties of the layer with that index. Otherwise a new layer is created.

insert_special_layer

Signature: unsigned int insert_special_layer (const LayerInfo props)

Description: Inserts a new special layer with the given properties

Returns:The index of the newly created layer

Special layers can be used to represent objects that should not participate in normal viewing or other related operations. Special layers are not reported as valid layers.

insert_special_layer_at

Signature: void insert_special_layer_at (unsigned int index,const LayerInfo props)

Description: Inserts a new special layer with the given properties at the given index

See insert_special_layer for a description of special layers.

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

is_editable?

Signature: [const] bool is_editable?

Description: Returns a value indicating whether the layout is editable.

Returns:True, if the layout is editable.

If a layout is editable, in general manipulation methods are enabled and some optimisations are disabled (i.e. shape arrays are expanded).

This method has been introduced in version 0.22.

is_special_layer?

Signature: [const] bool is_special_layer? (unsigned int layer_index)

Description: Returns true, if a layer index is a special layer index

Returns:true, if this is the case

is_valid_cell_index?

Signature: [const] bool is_valid_cell_index? (unsigned int cell_index)

Description: Returns true, if a cell index is a valid index

Returns:true, if this is the case

This method has been added in version 0.20.

is_valid_layer?

Signature: [const] bool is_valid_layer? (unsigned int layer_index)

Description: Returns true, if a layer index is a valid index

Returns:true, if this is the case

layer

Signature: unsigned int layer

Description: Creates a new internal layer

This method will create a new internal layer and return the layer index for this layer. The layer does not have any properties attached to it. That means, it is not going to be saved to a layout file unless it is given database properties with set_info.

This method is equivalent to "layer(RBA::LayerInfo::new())".

This method has been introduced in version 0.25.

Signature: unsigned int layer (const LayerInfo info)

Description: Finds or creates a layer with the given properties

If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. If "info" is anonymous (info.anonymous? is true), a new layer will always be created.

This method has been introduced in version 0.23.

Signature: unsigned int layer (string name)

Description: Finds or creates a layer with the given name

If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, a new one with theis name will be created and its index will be returned.

This method has been introduced in version 0.23.

Signature: unsigned int layer (int layer,int datatype)

Description: Finds or creates a layer with the given layer and datatype number

If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned.

This method has been introduced in version 0.23.

Signature: unsigned int layer (int layer,int datatype,string name)

Description: Finds or creates a layer with the given layer and datatype number and name

If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned.

This method has been introduced in version 0.23.

layer_indexes

Signature: [const] unsigned int[] layer_indexes

Description: Gets a list of valid layer's indices

This method returns an array with layer indices representing valid layers.

This method has been introduced in version 0.19.

layer_indices

Signature: [const] unsigned int[] layer_indices

Description: Gets a list of valid layer's indices

Use of this method is deprecated. Use layer_indexes instead

layer_infos

Signature: [const] LayerInfo[] layer_infos

Description: Gets a list of valid layer's properties

The method returns an array with layer properties representing valid layers. The sequence and length of this list corresponds to that of layer_indexes.

This method has been introduced in version 0.25.

layers

Signature: [const] unsigned int layers

Description: Returns the number of layers

The number of layers reports the maximum (plus 1) layer index used so far. Not all of the layers with an index in the range of 0 to layers-1 needs to be a valid layer. These layers can be either valid, special or unused. Use is_valid_layer? and is_special_layer? to test for the first two states.

meta_info_value

Signature: [const] string meta_info_value (string name)

Description: Gets the meta information value for a given name

See LayoutMetaInfo for details about layouts and meta information.

If no meta information with the given name exists, an empty string will be returned.

This method has been introduced in version 0.25.

move_layer

Signature: void move_layer (unsigned int src,unsigned int dest)

Description: Moves a layer

src:The layer index of the source layer.
dest:The layer index of the destination layer.

This method was introduced in version 0.19.

Move a layer from the source to the target. The target is not cleared before, so that this method merges shapes from the source with the target layer. The source layer is empty after that operation.

multi_clip

Signature: unsigned int[] multi_clip (unsigned int cell,Box[] boxes)

Description: Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle.

cell:The cell index of the cell to clip
boxes:The clip boxes in database units
Returns:The indexes of the new cells

This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells whose indexed are returned. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells.

This method has been added in version 0.21.

multi_clip_into

Signature: unsigned int[] multi_clip_into (unsigned int cell,Layout ptr target,Box[] boxes)

Description: Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle.

cell:The cell index of the cell to clip
boxes:The clip boxes in database units
target:The target layout
Returns:The indexes of the new cells

This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells in the given target layout. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells.

Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results. This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout.

This method has been added in version 0.21.

new

Signature: [static] new Layout ptr new (Manager manager)

Description: Creates a layout object attached to a manager

This constructor specifies a manager object which is used to store undo information for example.

Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application.

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

Signature: [static] new Layout ptr new

Description: Creates a layout object

Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application.

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

Signature: [static] new Layout ptr new (bool editable,Manager manager)

Description: Creates a layout object attached to a manager

This constructor specifies a manager object which is used to store undo information for example. It also allows to specify whether the layout is editable. In editable mode, some optimisations are disabled and the layout can be manipulated through a variety of methods.

This method was introduced in version 0.22.

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

Signature: [static] new Layout ptr new (bool editable)

Description: Creates a layout object

This constructor specifies whether the layout is editable. In editable mode, some optimisations are disabled and the layout can be manipulated through a variety of methods.

This method was introduced in version 0.22.

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

pcell_declaration

Signature: [const] const PCellDeclaration ptr pcell_declaration (string name)

Description: Gets a reference to the PCell declaration for the PCell with the given name

Returns a reference to the local PCell declaration with the given name. If the name is not a valid PCell name, this method returns nil.

Usually this method is used on library layouts that define PCells. Note that this method cannot be used on the layouts using the PCell from a library.

This method has been introduced in version 0.22.

Signature: [const] const PCellDeclaration ptr pcell_declaration (unsigned long pcell_id)

Description: Gets a reference to the PCell declaration for the PCell with the given PCell ID.

Returns a reference to the local PCell declaration with the given PCell id. If the parameter is not a valid PCell ID, this method returns nil. The PCell ID is the number returned by register_pcell for example.

Usually this method is used on library layouts that define PCells. Note that this method cannot be used on the layouts using the PCell from a library.

This method has been introduced in version 0.22.

pcell_id

Signature: [const] unsigned long pcell_id (string name)

Description: Gets the ID of the PCell with the given name

This method is equivalent to 'pcell_declaration(name).id'.

This method has been introduced in version 0.22.

pcell_ids

Signature: [const] unsigned long[] pcell_ids

Description: Gets the IDs of the PCells registered in the layout

Returns an array of PCell IDs.

This method has been introduced in version 0.24.

pcell_names

Signature: [const] string[] pcell_names

Description: Gets the names of the PCells registered in the layout

Returns an array of PCell names.

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 layout

This method has been introduced in version 0.24.

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 layout

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.24.

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

properties

Signature: [const] variant[] properties (unsigned long properties_id)

Description: Gets the properties set for a given properties ID

properties_id:The properties ID to get the properties for
Returns:The array of variants (see properties_id)

Basically performs the backward conversion of the 'properties_id' method. Given a properties ID, returns the properties set as an array of pairs of variants. In this array, each key and the value are stored as pairs (arrays with two elements). If the properties ID is not valid, an empty array is returned.

properties_id

Signature: unsigned long properties_id (variant[] properties)

Description: Gets the properties ID for a given properties set

properties:The array of pairs of variants (both elements can be integer, double or string)
Returns:The unique properties ID for that set

Before a set of properties can be attached to a shape, it must be converted into an ID that is unique for that set. The properties set must be given as a list of pairs of variants, each pair describing a name and a value. The name acts as the key for the property and does not need to be a string (it can be an integer or double value as well). The backward conversion can be performed with the 'properties' method.

property

Signature: 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 properties ID to retrieve the property value. This method has been introduced in version 0.24.

prune_cell

Signature: void prune_cell (unsigned int cell_index,int levels)

Description: Deletes a cell plus subcells not used otherwise

cell_index:The index of the cell to delete
levels:The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.)

This deletes a cell and also all sub cells of the cell which are not used otherwise. The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. All instances of this cell are deleted as well.

This method has been introduced in version 0.20.

prune_subcells

Signature: void prune_subcells (unsigned int cell_index,int levels)

Description: Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy

cell_index:The root cell from which to delete a sub cells
levels:The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.)

This deletes all sub cells of the cell which are not used otherwise. All instances of the deleted cells are deleted as well. It is possible to specify how many levels of hierarchy below the given root cell are considered.

This method has been introduced in version 0.20.

read

Signature: LayerMap read (string filename)

Description: Load the layout from the given file

filename:The name of the file to load.
Returns:A layer map that contains the mapping used by the reader including the layers that have been created.

The format of the file is determined automatically and automatic unzipping is provided. No particular options can be specified.

This method has been added in version 0.18.

Signature: LayerMap read (string filename,const LoadLayoutOptions options)

Description: Load the layout from the given file with options

filename:The name of the file to load.
options:The options object specifying further options for the reader.
Returns:A layer map that contains the mapping used by the reader including the layers that have been created.

The format of the file is determined automatically and automatic unzipping is provided. In this version, some reader options can be specified.

This method has been added in version 0.18.

register_pcell

Signature: unsigned long register_pcell (string name,PCellDeclaration ptr declaration)

Description: Registers a PCell declaration under the given name

Registers a local PCell in the current layout. If a declaration with that name alreay exists, it is replaced with the new declaration.

This method has been introduced in version 0.22.

remove_meta_info

Signature: void remove_meta_info (string name)

Description: Removes meta information from the layout

See LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.25.

rename_cell

Signature: void rename_cell (unsigned int index,string name)

Description: name

set_info

Signature: void set_info (unsigned int index,const LayerInfo props)

Description: Sets the info structure for a specified layer

set_property

Signature: void set_property (variant key,variant value)

Description: Set 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. This method has been introduced in version 0.24.

start_changes

Signature: void start_changes

Description: Signals the start of an operation bringing the layout into invalid state

This method should be called whenever the layout is about to be brought into an invalid state. After calling this method, under_construction? returns true which tells foreign code (i.e. the asynchronous painter or the cell tree view) not to use this layout object.

This state is cancelled by the end_changes method. The start_changes method can be called multiple times and must be cancelled the same number of times.

This method can be used to speed up certain operations. For example iterating over the layout with a RecursiveShapeIterator while modifying other layers of the layout can be very inefficient, because inside the loop the layout's state is invalidate and updated frequently. Putting a update and start_changes sequence before the loop (use both methods in that order!) and a end_changes call after the loop can improve the performance dramatically.

In addition, it can be necessary to prevent redraw operations in certain cases by using start_changes .. end_changes, in particular when it is possible to put a layout object into an invalid state temporarily.

While the layout is under construction update can be called to update the internal state explicitly if required. This for example might be necessary to update the cell bounding boxes or to redo the sorting for region queries.

swap_layers

Signature: void swap_layers (unsigned int a,unsigned int b)

Description: Swap two layers

a:The first of the layers to swap.
b:The second of the layers to swap.

Swaps the shapes of both layers.

This method was introduced in version 0.19.

top_cell

Signature: Cell ptr top_cell

Description: Returns the top cell object

Returns:The Cell object of the top cell

If the layout has a single top cell, this method returns the top cell's Cell object. If the layout does not have a top cell, this method returns "nil". If the layout has multiple top cells, this method raises an error.

This method has been introduced in version 0.23.

top_cells

Signature: Cell ptr[] top_cells

Description: Returns the top cell objects

Returns:The Cell objects of the top cells

This method returns and array of Cell objects representing the top cells of the layout. This array can be empty, if the layout does not have a top cell (i.e. no cell at all).

This method has been introduced in version 0.23.

transform

Signature: void transform (const Trans trans)

Description: Transforms the layout with the given transformation

This method has been introduced in version 0.23.

Signature: void transform (const ICplxTrans trans)

Description: Transforms the layout with the given complex integer transformation

This method has been introduced in version 0.23.

Signature: void transform (const DTrans trans)

Description: Transforms the layout with the given transformation, which is in micrometer units

This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a Trans argument.

This variant has been introduced in version 0.25.

Signature: void transform (const DCplxTrans trans)

Description: Transforms the layout with the given complex integer transformation, which is in micrometer units

This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a ICplxTrans argument.

This method has been introduced in version 0.23.

under_construction?

Signature: [const] bool under_construction?

Description: Returns true if the layout object is under construction

A layout object is either under construction if a transaction is ongoing or the layout is brought into invalid state by "start_changes".

update

Signature: void update

Description: Updates the internals of the layout

This method updates the internal state of the layout. Usually this is done automatically This method is provided to ensure this explicitly. This can be useful while using start_changes and end_changes to wrap a performance-critical operation. See start_changes for more details.

write

Signature: void write (string filename,bool gzip,const SaveLayoutOptions options)

Description: Writes the layout to a stream file

filename:The file to which to write the layout
gzip:Ignored
options:The option set to use for writing. See SaveLayoutOptions for details

Use of this method is deprecated

Signature: void write (string filename,const SaveLayoutOptions options)

Description: Writes the layout to a stream file

filename:The file to which to write the layout
options:The option set to use for writing. See SaveLayoutOptions for details

This version automatically determines the compression mode from the file name. The file is written with zlib compression if the suffix is ".gz" or ".gzip".

This variant has been introduced in version 0.23.

Signature: void write (string filename)

Description: Writes the layout to a stream file

filename:The file to which to write the layout