API reference - Class SaveLayoutOptions

Notation used in Ruby API documentation

Description: Options for saving layouts

This class describes the various options for saving a layout to a stream file (GDS2, OASIS and others). There are: layers to be saved, cell or cells to be saved, scale factor, format, database unit and format specific options.

Usually the default constructor provides a suitable object. Please note, that the format written is "GDS2" by default. Either explicitly set a format using format= or derive the format from the file name using set_format_from_filename.

The layers are specified by either selecting all layers or by defining layer by layer using the add_layer method. select_all_layers will explicitly select all layers for saving, deselect_all_layers will explicitly clear the list of layers.

Cells are selected in a similar fashion: by default, all cells are selected. Using add_cell, specific cells can be selected for saving. All these cells plus their hierarchy will then be written to the stream file.

Public constructors

new SaveLayoutOptions ptrnewDefault constructor

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.
voidadd_cell(unsigned int cell_index)Add a cell (plus hierarchy) to be saved
voidadd_layer(unsigned int layer_index,
const LayerInfo properties)
Add a layer to be saved
voidadd_this_cell(unsigned int cell_index)Adds a cell to be saved
voidassign(const SaveLayoutOptions other)Assigns another object to self
[const]boolcif_blank_separatorGets a flag indicating whether blanks shall be used as x/y separator characters
voidcif_blank_separator=(bool arg1)Sets a flag indicating whether blanks shall be used as x/y separator characters
[const]boolcif_dummy_callsGets a flag indicating whether dummy calls shall be written
voidcif_dummy_calls=(bool arg1)Sets a flag indicating whether dummy calls shall be written
voidclear_cellsClears all cells to be saved
[const]doubledbuGet the explicit database unit if one is set
voiddbu=(double dbu)Set the database unit to be used in the stream file
voiddeselect_all_layersUnselect all layers: no layer will be saved
[const]new SaveLayoutOptions ptrdupCreates a copy of self
[const]intdxf_polygon_modeSpecifies how to write polygons.
voiddxf_polygon_mode=(int mode)Specifies how to write polygons.
[const]stringformatGets the format name
voidformat=(string format)Select a format
[const]stringgds2_libnameGet the library name
voidgds2_libname=(string libname)Set the library name
[const]unsigned intgds2_max_cellname_lengthGet the maximum length of cell names
voidgds2_max_cellname_length=(unsigned int length)Maximum length of cell names
[const]unsigned intgds2_max_vertex_countGet the maximum number of vertices for polygons to write
voidgds2_max_vertex_count=(unsigned int count)Set the maximum number of vertices for polygons to write
voidgds2_multi_xy_records=(bool flag)Use multiple XY records in BOUNDARY elements for unlimited large polygons
[const]boolgds2_multi_xy_records?Get the property enabling multiple XY records for BOUNDARY elements
voidgds2_no_zero_length_paths=(bool flag)Eliminates zero-length paths if true
[const]boolgds2_no_zero_length_paths?Gets a value indicating whether zero-length paths are eliminated
[const]doublegds2_user_unitsGet the user units
voidgds2_user_units=(double uu)Set the users units to write into the GDS file
voidgds2_write_cell_properties=(bool flag)Enables writing of cell properties if set to true
[const]boolgds2_write_cell_properties?Gets a value indicating whether cell properties are written
voidgds2_write_file_properties=(bool flag)Enables writing of file properties if set to true
[const]boolgds2_write_file_properties?Gets a value indicating whether layout properties are written
voidgds2_write_timestamps=(bool flag)Write the current time into the GDS2 timestamps if set to true
[const]boolgds2_write_timestamps?Gets a value indicating whether the current time is written into the GDS2 timestamp fields
voidkeep_instances=(bool flag)Enables or disables instances for dropped cells
[const]boolkeep_instances?Gets a flag indicating whether instances will be kept even if the target cell is dropped
voidno_empty_cells=(bool flag)Don't write empty cells if this flag is set
[const]boolno_empty_cells?Returns a flag indicating whether empty cells are not written.
[const]intoasis_compression_levelGet the OASIS compression level
voidoasis_compression_level=(int level)Set the OASIS compression level
voidoasis_recompress=(bool flag)Set OASIS recompression mode
[const]booloasis_recompress?Get the OASIS recompression mode
voidoasis_strict_mode=(bool flag)Sets a value indicating whether to write strict-mode OASIS files
[const]booloasis_strict_mode?Gets a value indicating whether to write strict-mode OASIS files
[const]stringoasis_substitution_charGets the substitution character
voidoasis_substitution_char=(string char)Sets the substitution character for a-strings and n-strings
voidoasis_write_cblocks=(bool flag)Sets a value indicating whether to write compressed CBLOCKS per cell
[const]booloasis_write_cblocks?Gets a value indicating whether to write compressed CBLOCKS per cell
voidoasis_write_std_properties=(bool mode)Sets a value indication whether standard properties shall be written
[const]booloasis_write_std_properties?Gets a value indication whether standard properties shall be written
[const]doublescale_factorGets the scaling factor currently set
voidscale_factor=(double scale_factor)Set the scaling factor for the saving
voidselect_all_cellsSelect all cells to save
voidselect_all_layersSelect all layers to be saved
voidselect_cell(unsigned int cell_index)Selects a cell to be saved (plus hierarchy below)
voidselect_this_cell(unsigned int cell_index)Selects a cell to be saved
boolset_format_from_filename(string filename)Select a format from the given file name
voidwrite_context_info=(bool flag)Enables or disables context information
[const]boolwrite_context_info?Gets a flag indicating whether context information will be stored

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

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]boolgds2_no_zero_length_pathsUse of this method is deprecated. Use gds2_no_zero_length_paths? instead
[const]boolgds2_write_cell_propertiesUse of this method is deprecated. Use gds2_write_cell_properties? instead
[const]boolgds2_write_file_propertiesUse of this method is deprecated. Use gds2_write_file_properties? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

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.

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.

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

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

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.

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.

void add_cell(unsigned int cell_index)

Description: Add a cell (plus hierarchy) to be saved

The index of the cell must be a valid index in the context of the layout that will be saved. This method clears the 'select all cells' flag.

This method also implicitly adds the children of that cell. A method that does not add the children in add_this_cell.

void add_layer(unsigned int layer_index,const LayerInfo properties)

Description: Add a layer to be saved

Adds the layer with the given index to the layer list that will be written. If all layers have been selected previously, all layers will be unselected first and only the new layer remains.

The 'properties' argument can be used to assign different layer properties than the ones present in the layout. Pass a default LayerInfo object to this argument to use the properties from the layout object. Construct a valid LayerInfo object with explicit layer, datatype and possibly a name to override the properties stored in the layout.

void add_this_cell(unsigned int cell_index)

Description: Adds a cell to be saved

The index of the cell must be a valid index in the context of the layout that will be saved. This method clears the 'select all cells' flag. Unlike add_cell, this method does not implicitly add all children of that cell.

This method has been added in version 0.23.

void assign(const SaveLayoutOptions other)

Description: Assigns another object to self

[const] bool cif_blank_separator

Description: Gets a flag indicating whether blanks shall be used as x/y separator characters

See cif_blank_separator= method for a description of that property. This property has been added in version 0.23.10.

Python specific notes:

The object exposes a readable attribute 'cif_blank_separator'. This is the getter.

void cif_blank_separator=(bool arg1)

Description: Sets a flag indicating whether blanks shall be used as x/y separator characters

If this property is set to true, the x and y coordinates are separated with blank characters rather than comma characters. This property has been added in version 0.23.10.

Python specific notes:

The object exposes a writable attribute 'cif_blank_separator'. This is the setter.

[const] bool cif_dummy_calls

Description: Gets a flag indicating whether dummy calls shall be written

See cif_dummy_calls= method for a description of that property. This property has been added in version 0.23.10.

Python specific notes:

The object exposes a readable attribute 'cif_dummy_calls'. This is the getter.

void cif_dummy_calls=(bool arg1)

Description: Sets a flag indicating whether dummy calls shall be written

If this property is set to true, dummy calls will be written in the top level entity of the CIF file calling every top cell. This option is useful for enhanced compatibility with other tools.

This property has been added in version 0.23.10.

Python specific notes:

The object exposes a writable attribute 'cif_dummy_calls'. This is the setter.

void clear_cells

Description: Clears all cells to be saved

This method can be used to ensure that no cell is selected before add_cell is called to specify a cell. This method clears the 'select all cells' flag.

This method has been added in version 0.22.

void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

[const] double dbu

Description: Get the explicit database unit if one is set

See dbu= for a description of that attribute.

Python specific notes:

The object exposes a readable attribute 'dbu'. This is the getter.

void dbu=(double dbu)

Description: Set the database unit to be used in the stream file

By default, the database unit of the layout is used. This method allows to explicitly use a different database unit. A scale factor is introduced automatically which scales all layout objects accordingly so their physical dimensions remain the same. When scaling to a larger database unit or one that is not an integer fraction of the original one, rounding errors may occur and the layout may become slightly distorted.

Python specific notes:

The object exposes a writable attribute 'dbu'. This is the setter.

void deselect_all_layers

Description: Unselect all layers: no layer will be saved

This method will clear all layers selected with add_layer so far and clear the 'select all layers' flag. Using this method is the only way to save a layout without any layers.

void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

[const] bool destroyed?

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

Use of this method is deprecated. Use _destroyed? instead

[const] new SaveLayoutOptions ptr dup

Description: Creates a copy of self

[const] int dxf_polygon_mode

Description: Specifies how to write polygons.

See dxf_polygon_mode= for a description of this property.

This property has been added in version 0.21.3.

Python specific notes:

The object exposes a readable attribute 'dxf_polygon_mode'. This is the getter.

void dxf_polygon_mode=(int mode)

Description: Specifies how to write polygons.

The mode is 0 (write POLYLINE entities), 1 (write LWPOLYLINE entities), 2 (decompose into SOLID entities) or or 3 (write HATCH entities).

This property has been added in version 0.21.3.

Python specific notes:

The object exposes a writable attribute 'dxf_polygon_mode'. This is the setter.

[const] string format

Description: Gets the format name

See format= for a description of that method.

Python specific notes:

The object exposes a readable attribute 'format'. This is the getter.

void format=(string format)

Description: Select a format

The format string can be either "GDS2", "OASIS", "CIF" or "DXF". Other formats may be available if a suitable plugin is installed.

Python specific notes:

The object exposes a writable attribute 'format'. This is the setter.

[const] string gds2_libname

Description: Get the library name

See gds2_libname= method for a description of the library name. This property has been added in version 0.18.

Python specific notes:

The object exposes a readable attribute 'gds2_libname'. This is the getter.

void gds2_libname=(string libname)

Description: Set the library name

The library name is the string written into the LIBNAME records of the GDS file. The library name should not be an empty string and is subject to certain limitations in the character choice.

This property has been added in version 0.18.

Python specific notes:

The object exposes a writable attribute 'gds2_libname'. This is the setter.

[const] unsigned int gds2_max_cellname_length

Description: Get the maximum length of cell names

See gds2_max_cellname_length= method for a description of the maximum cell name length. This property has been added in version 0.18.

Python specific notes:

The object exposes a readable attribute 'gds2_max_cellname_length'. This is the getter.

void gds2_max_cellname_length=(unsigned int length)

Description: Maximum length of cell names

This property describes the maximum number of characters for cell names. Longer cell names will be shortened.

This property has been added in version 0.18.

Python specific notes:

The object exposes a writable attribute 'gds2_max_cellname_length'. This is the setter.

[const] unsigned int gds2_max_vertex_count

Description: Get the maximum number of vertices for polygons to write

See gds2_max_vertex_count= method for a description of the maximum vertex count. This property has been added in version 0.18.

Python specific notes:

The object exposes a readable attribute 'gds2_max_vertex_count'. This is the getter.

void gds2_max_vertex_count=(unsigned int count)

Description: Set the maximum number of vertices for polygons to write

This property describes the maximum number of point for polygons in GDS2 files. Polygons with more points will be split. The minimum value for this property is 4. The maximum allowed value is about 4000 or 8000, depending on the GDS2 interpretation. If gds2_multi_xy_records is true, this property is not used. Instead, the number of points is unlimited.

This property has been added in version 0.18.

Python specific notes:

The object exposes a writable attribute 'gds2_max_vertex_count'. This is the setter.

void gds2_multi_xy_records=(bool flag)

Description: Use multiple XY records in BOUNDARY elements for unlimited large polygons

Setting this property to true allows to produce unlimited polygons at the cost of incompatible formats. Setting it to true disables the gds2_max_vertex_count setting.

This property has been added in version 0.18.

Python specific notes:

The object exposes a writable attribute 'gds2_multi_xy_records'. This is the setter.

[const] bool gds2_multi_xy_records?

Description: Get the property enabling multiple XY records for BOUNDARY elements

See gds2_multi_xy_records= method for a description of this property. This property has been added in version 0.18.

Python specific notes:

The object exposes a readable attribute 'gds2_multi_xy_records'. This is the getter.

[const] bool gds2_no_zero_length_paths

Description: Gets a value indicating whether zero-length paths are eliminated

Use of this method is deprecated. Use gds2_no_zero_length_paths? instead

void gds2_no_zero_length_paths=(bool flag)

Description: Eliminates zero-length paths if true

If this property is set to true, paths with zero length will be converted to BOUNDARY objects.

This property has been added in version 0.23.

Python specific notes:

The object exposes a writable attribute 'gds2_no_zero_length_paths'. This is the setter.

[const] bool gds2_no_zero_length_paths?

Description: Gets a value indicating whether zero-length paths are eliminated

This property has been added in version 0.23.

Python specific notes:

The object exposes a readable attribute 'gds2_no_zero_length_paths'. This is the getter.

The object exposes a readable attribute 'gds2_no_zero_length_paths'. This is the getter.

[const] double gds2_user_units

Description: Get the user units

See gds2_user_units= method for a description of the user units. This property has been added in version 0.18.

Python specific notes:

The object exposes a readable attribute 'gds2_user_units'. This is the getter.

void gds2_user_units=(double uu)

Description: Set the users units to write into the GDS file

The user units of a GDS file are rarely used and usually are set to 1 (micron). The intention of the user units is to specify the display units. KLayout ignores the user unit and uses microns as the display unit. The user unit must be larger than zero.

This property has been added in version 0.18.

Python specific notes:

The object exposes a writable attribute 'gds2_user_units'. This is the setter.

[const] bool gds2_write_cell_properties

Description: Gets a value indicating whether cell properties are written

Use of this method is deprecated. Use gds2_write_cell_properties? instead

void gds2_write_cell_properties=(bool flag)

Description: Enables writing of cell properties if set to true

If this property is set to true, cell properties will be written as PROPATTR/PROPVALUE records immediately following the BGNSTR records. This is a non-standard extension and is therefore disabled by default.

This property has been added in version 0.23.

Python specific notes:

The object exposes a writable attribute 'gds2_write_cell_properties'. This is the setter.

[const] bool gds2_write_cell_properties?

Description: Gets a value indicating whether cell properties are written

This property has been added in version 0.23.

Python specific notes:

The object exposes a readable attribute 'gds2_write_cell_properties'. This is the getter.

The object exposes a readable attribute 'gds2_write_cell_properties'. This is the getter.

[const] bool gds2_write_file_properties

Description: Gets a value indicating whether layout properties are written

Use of this method is deprecated. Use gds2_write_file_properties? instead

void gds2_write_file_properties=(bool flag)

Description: Enables writing of file properties if set to true

If this property is set to true, layout properties will be written as PROPATTR/PROPVALUE records immediately following the BGNLIB records. This is a non-standard extension and is therefore disabled by default.

This property has been added in version 0.24.

Python specific notes:

The object exposes a writable attribute 'gds2_write_file_properties'. This is the setter.

[const] bool gds2_write_file_properties?

Description: Gets a value indicating whether layout properties are written

This property has been added in version 0.24.

Python specific notes:

The object exposes a readable attribute 'gds2_write_file_properties'. This is the getter.

The object exposes a readable attribute 'gds2_write_file_properties'. This is the getter.

void gds2_write_timestamps=(bool flag)

Description: Write the current time into the GDS2 timestamps if set to true

If this property is set to false, the time fields will all be zero. This somewhat simplifies compare and diff applications.

This property has been added in version 0.21.16.

Python specific notes:

The object exposes a writable attribute 'gds2_write_timestamps'. This is the setter.

[const] bool gds2_write_timestamps?

Description: Gets a value indicating whether the current time is written into the GDS2 timestamp fields

This property has been added in version 0.21.16.

Python specific notes:

The object exposes a readable attribute 'gds2_write_timestamps'. This is the getter.

[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

void keep_instances=(bool flag)

Description: Enables or disables instances for dropped cells

If this flag is set to true, instances for cells will be written, even if the cell is dropped. That may happen, if cells are selected with select_this_cell or add_this_cell or no_empty_cells is used. Even if cells called by such cells are not selected, instances will be written for that cell if "keep_instances" is true. That feature is supported by the GDS format currently and results in "ghost cells" which have instances but no cell definition.

The default value is false (instances of dropped cells are not written).

This method was introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'keep_instances'. This is the setter.

[const] bool keep_instances?

Description: Gets a flag indicating whether instances will be kept even if the target cell is dropped

See keep_instances= for details about this flag.

This method was introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'keep_instances'. This is the getter.

[static] new SaveLayoutOptions ptr new

Description: Default constructor

This will initialize the scale factor to 1.0, the database unit is set to "same as original" and all layers are selected as well as all cells. The default format is GDS2.

Python specific notes:

This method is the default initializer of the object

void no_empty_cells=(bool flag)

Description: Don't write empty cells if this flag is set

By default, all cells are written (no_empty_cells is false). This applies to empty cells which do not contain shapes for the specified layers as well as cells which are empty because they reference empty cells only.

Python specific notes:

The object exposes a writable attribute 'no_empty_cells'. This is the setter.

[const] bool no_empty_cells?

Description: Returns a flag indicating whether empty cells are not written.

Python specific notes:

The object exposes a readable attribute 'no_empty_cells'. This is the getter.

[const] int oasis_compression_level

Description: Get the OASIS compression level

See oasis_compression_level= method for a description of the OASIS compression level.

Python specific notes:

The object exposes a readable attribute 'oasis_compression_level'. This is the getter.

void oasis_compression_level=(int level)

Description: Set the OASIS compression level

The OASIS compression level is an integer number between 0 and 10. 0 basically is no compression, 1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate algorithm to find shape arrays which uses 2nd and futher neighbor distances. The higher the level, the higher the memory requirements and run times. Setting this property clears all format specific options for other formats such as GDS.

Python specific notes:

The object exposes a writable attribute 'oasis_compression_level'. This is the setter.

void oasis_recompress=(bool flag)

Description: Set OASIS recompression mode

If this flag is true, shape arrays already existing will be resolved and compression is applied to the individual shapes again. If this flag is false (the default), shape arrays already existing will be written as such.

Setting this property clears all format specific options for other formats such as GDS.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'oasis_recompress'. This is the setter.

[const] bool oasis_recompress?

Description: Get the OASIS recompression mode

See oasis_recompression= method for a description of the OASIS compression level. This method has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'oasis_recompress'. This is the getter.

void oasis_strict_mode=(bool flag)

Description: Sets a value indicating whether to write strict-mode OASIS files

Setting this property clears all format specific options for other formats such as GDS.

Python specific notes:

The object exposes a writable attribute 'oasis_strict_mode'. This is the setter.

[const] bool oasis_strict_mode?

Description: Gets a value indicating whether to write strict-mode OASIS files

Python specific notes:

The object exposes a readable attribute 'oasis_strict_mode'. This is the getter.

[const] string oasis_substitution_char

Description: Gets the substitution character

See oasis_substitution_char for details. This attribute has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'oasis_substitution_char'. This is the getter.

void oasis_substitution_char=(string char)

Description: Sets the substitution character for a-strings and n-strings

The substitution character is used in place of invalid characters. The value of this attribute is a string which is either empty or a single character. If the string is empty, no substitution is made at the risk of producing invalid OASIS files.

This attribute has been introduce in version 0.23.

Python specific notes:

The object exposes a writable attribute 'oasis_substitution_char'. This is the setter.

void oasis_write_cblocks=(bool flag)

Description: Sets a value indicating whether to write compressed CBLOCKS per cell

Setting this property clears all format specific options for other formats such as GDS.

Python specific notes:

The object exposes a writable attribute 'oasis_write_cblocks'. This is the setter.

[const] bool oasis_write_cblocks?

Description: Gets a value indicating whether to write compressed CBLOCKS per cell

Python specific notes:

The object exposes a readable attribute 'oasis_write_cblocks'. This is the getter.

void oasis_write_std_properties=(bool mode)

Description: Sets a value indication whether standard properties shall be written

If this value is 0, no standard properties are written. If 1, S_TOP_CELL and some other global standard properties are written. If 2, per-cell bounding boxes are written too. The standard properties defined by strict mode are not affected by this mode. By default, global standard properties are written (mode 1).

Setting this property clears all format specific options for other formats such as GDS.

This method has been introduced in version 0.24.

Python specific notes:

The object exposes a writable attribute 'oasis_write_std_properties'. This is the setter.

[const] bool oasis_write_std_properties?

Description: Gets a value indication whether standard properties shall be written

See oasis_write_std_properties= method for a description of this flag. This method has been introduced in version 0.24.

Python specific notes:

The object exposes a readable attribute 'oasis_write_std_properties'. This is the getter.

[const] double scale_factor

Description: Gets the scaling factor currently set

Python specific notes:

The object exposes a readable attribute 'scale_factor'. This is the getter.

void scale_factor=(double scale_factor)

Description: Set the scaling factor for the saving

Using a scaling factor will scale all objects accordingly. This scale factor adds to a potential scaling implied by using an explicit database unit.

Be aware that rounding effects may occur if fractional scaling factors are used.

By default, no scaling is applied.

Python specific notes:

The object exposes a writable attribute 'scale_factor'. This is the setter.

void select_all_cells

Description: Select all cells to save

This method will clear all cells specified with add_cells so far and set the 'select all cells' flag. This is the default.

void select_all_layers

Description: Select all layers to be saved

This method will clear all layers selected with add_layer so far and set the 'select all layers' flag. This is the default.

void select_cell(unsigned int cell_index)

Description: Selects a cell to be saved (plus hierarchy below)

This method is basically a convenience method that combines clear_cells and add_cell. This method clears the 'select all cells' flag.

This method has been added in version 0.22.

void select_this_cell(unsigned int cell_index)

Description: Selects a cell to be saved

This method is basically a convenience method that combines clear_cells and add_this_cell. This method clears the 'select all cells' flag.

This method has been added in version 0.23.

bool set_format_from_filename(string filename)

Description: Select a format from the given file name

This method will set the format according to the file's extension.

This method has been introduced in version 0.22. Beginning with version 0.23, this method always returns true, since the only consumer for the return value, Layout#write, now ignores that parameter and automatically determines the compression mode from the file name.

void write_context_info=(bool flag)

Description: Enables or disables context information

If this flag is set to false, no context information for PCell or library cell instances is written. Those cells will be converted to plain cells and KLayout will not be able to restore the identity of those cells. Use this option to enforce compatibility with other tools that don't understand the context information of KLayout.

The default value is true (context information is stored). Not all formats support context information, hence that flag has no effect for formats like CIF or DXF.

This method was introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'write_context_info'. This is the setter.

[const] bool write_context_info?

Description: Gets a flag indicating whether context information will be stored

See write_context_info= for details about this flag.

This method was introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'write_context_info'. This is the getter.