KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

API reference - Class SaveLayoutOptions

Notation used in Ruby API documentation

Module: db

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

[const]SaveLayoutOptions ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
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
voidcif_blank_separator=(bool flag)Sets a flag indicating whether blanks shall be used as x/y separator characters
[const]boolcif_blank_separator?Gets a flag indicating whether blanks shall be used as x/y separator characters
voidcif_dummy_calls=(bool flag)Sets a flag indicating whether dummy calls shall be written
[const]boolcif_dummy_calls?Gets 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_countGets the maximum number of vertices for polygons to write
voidgds2_max_vertex_count=(unsigned int count)Sets the maximum number of vertices for polygons to write
voidgds2_multi_xy_records=(bool flag)Uses multiple XY records in BOUNDARY elements for unlimited large polygons
[const]boolgds2_multi_xy_records?Gets 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
voidgds2_resolve_skew_arrays=(bool flag)Resolves skew arrays into single instances
[const]boolgds2_resolve_skew_arrays?Gets a value indicating whether to resolve skew arrays into single instances
[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)Writes 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
[const]doublemag_lambdaGets the lambda value
voidmag_lambda=(double lambda)Specifies the lambda value to used for writing
[const]stringmag_techGets the technology string used for writing
voidmag_tech=(string tech)Specifies the technology string used for writing
voidmag_write_timestamp=(bool f)Specifies whether to write a timestamp
[const]boolmag_write_timestamp?Gets a value indicating whether to write a timestamp
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_permissive=(bool flag)Sets OASIS permissive mode
[const]booloasis_permissive?Gets the OASIS permissive mode
voidoasis_recompress=(bool flag)Sets OASIS recompression mode
[const]booloasis_recompress?Gets 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_cell_bounding_boxes=(bool flag)Sets a value indicating whether cell bounding boxes are written
[const]booloasis_write_cell_bounding_boxes?Gets a value indicating whether cell bounding boxes are written
voidoasis_write_std_properties=(bool flag)Sets a value indicating whether standard properties will be written
[const]booloasis_write_std_properties?Gets a value indicating whether standard properties will 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)

[const]boolcif_blank_separatorUse of this method is deprecated. Use cif_blank_separator? instead
[const]boolcif_dummy_callsUse of this method is deprecated. Use cif_dummy_calls? instead
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

_const_cast

Signature: [const] SaveLayoutOptions ptr _const_cast

Description: Returns a non-const reference to self.

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

This method has been introduced in version 0.29.6.

_create

Signature: void _create

Description: Ensures the C++ object is created

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

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

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

_destroyed?

Signature: [const] bool _destroyed?

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

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

_is_const_object?

Signature: [const] bool _is_const_object?

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

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

_manage

Signature: void _manage

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

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

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

_unmanage

Signature: void _unmanage

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

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

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

add_cell

Signature: 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.

add_layer

Signature: 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.

add_this_cell

Signature: 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.

assign

Signature: void assign (const SaveLayoutOptions other)

Description: Assigns another object to self

cif_blank_separator

Signature: [const] bool cif_blank_separator

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

Use of this method is deprecated. Use cif_blank_separator? instead

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

The predicate version (cif_blank_separator?) has been added in version 0.25.1.

Python specific notes:
The object exposes a readable attribute 'cif_blank_separator'. This is the getter.
This method is available as 'cif_blank_separator_' in Python to distiguish it from the property with the same name.

cif_blank_separator=

Signature: void cif_blank_separator= (bool flag)

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.

cif_blank_separator?

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

The predicate version (cif_blank_separator?) has been added in version 0.25.1.

Python specific notes:
The object exposes a readable attribute 'cif_blank_separator'. This is the getter.
This method is available as 'cif_blank_separator_' in Python to distiguish it from the property with the same name.

cif_dummy_calls

Signature: [const] bool cif_dummy_calls

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

Use of this method is deprecated. Use cif_dummy_calls? instead

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

The predicate version (cif_blank_separator?) has been added in version 0.25.1.

Python specific notes:
The object exposes a readable attribute 'cif_dummy_calls'. This is the getter.
This method is available as 'cif_dummy_calls_' in Python to distiguish it from the property with the same name.

cif_dummy_calls=

Signature: void cif_dummy_calls= (bool flag)

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.

cif_dummy_calls?

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

The predicate version (cif_blank_separator?) has been added in version 0.25.1.

Python specific notes:
The object exposes a readable attribute 'cif_dummy_calls'. This is the getter.
This method is available as 'cif_dummy_calls_' in Python to distiguish it from the property with the same name.

clear_cells

Signature: 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.

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

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

dbu

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

dbu=

Signature: 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 one 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.

deselect_all_layers

Signature: 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.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

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

destroyed?

Signature: [const] bool destroyed?

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

Use of this method is deprecated. Use _destroyed? instead

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

dup

Signature: [const] new SaveLayoutOptions ptr dup

Description: Creates a copy of self

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

dxf_polygon_mode

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

dxf_polygon_mode=

Signature: 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), 3 (write HATCH entities), or 4 (write LINE entities).

This property has been added in version 0.21.3. '4', in version 0.25.6.

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

format

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

format=

Signature: 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.

gds2_libname

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

gds2_libname=

Signature: 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.

gds2_max_cellname_length

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

gds2_max_cellname_length=

Signature: 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.

gds2_max_vertex_count

Signature: [const] unsigned int gds2_max_vertex_count

Description: Gets 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.

gds2_max_vertex_count=

Signature: void gds2_max_vertex_count= (unsigned int count)

Description: Sets 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.

gds2_multi_xy_records=

Signature: void gds2_multi_xy_records= (bool flag)

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

Setting this property to true allows producing polygons with an unlimited number of points 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.

gds2_multi_xy_records?

Signature: [const] bool gds2_multi_xy_records?

Description: Gets 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.

gds2_no_zero_length_paths

Signature: [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

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.
This method is available as 'gds2_no_zero_length_paths_' in Python to distiguish it from the property with the same name.

gds2_no_zero_length_paths=

Signature: 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.

gds2_no_zero_length_paths?

Signature: [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.
This method is available as 'gds2_no_zero_length_paths_' in Python to distiguish it from the property with the same name.

gds2_resolve_skew_arrays=

Signature: void gds2_resolve_skew_arrays= (bool flag)

Description: Resolves skew arrays into single instances

Setting this property to true will make skew (non-orthogonal) arrays being resolved into single instances. Skew arrays happen if either the row or column vector isn't parallel to x or y axis. Such arrays can cause problems with some legacy software and can be disabled with this option.

This property has been added in version 0.27.1.

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

gds2_resolve_skew_arrays?

Signature: [const] bool gds2_resolve_skew_arrays?

Description: Gets a value indicating whether to resolve skew arrays into single instances

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

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

gds2_user_units

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

gds2_user_units=

Signature: 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.

gds2_write_cell_properties

Signature: [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

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.
This method is available as 'gds2_write_cell_properties_' in Python to distiguish it from the property with the same name.

gds2_write_cell_properties=

Signature: 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.

gds2_write_cell_properties?

Signature: [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.
This method is available as 'gds2_write_cell_properties_' in Python to distiguish it from the property with the same name.

gds2_write_file_properties

Signature: [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

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.
This method is available as 'gds2_write_file_properties_' in Python to distiguish it from the property with the same name.

gds2_write_file_properties=

Signature: 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.

gds2_write_file_properties?

Signature: [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.
This method is available as 'gds2_write_file_properties_' in Python to distiguish it from the property with the same name.

gds2_write_timestamps=

Signature: void gds2_write_timestamps= (bool flag)

Description: Writes 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.

gds2_write_timestamps?

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

is_const_object?

Signature: [const] bool is_const_object?

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

Use of this method is deprecated. Use _is_const_object? instead

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

keep_instances=

Signature: 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.

keep_instances?

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

mag_lambda

Signature: [const] double mag_lambda

Description: Gets the lambda value

See mag_lambda= method for a description of this attribute. This property has been added in version 0.26.2.

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

mag_lambda=

Signature: void mag_lambda= (double lambda)

Description: Specifies the lambda value to used for writing

The lambda value is the basic unit of the layout. The layout is brought to units of this value. If the layout is not on-grid on this unit, snapping will happen. If the value is less or equal to zero, KLayout will use the lambda value stored inside the layout set by a previous read operation of a MAGIC file. The lambda value is stored in the Layout object as the "lambda" metadata attribute.

This property has been added in version 0.26.2.

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

mag_tech

Signature: [const] string mag_tech

Description: Gets the technology string used for writing

See mag_tech= method for a description of this attribute. This property has been added in version 0.26.2.

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

mag_tech=

Signature: void mag_tech= (string tech)

Description: Specifies the technology string used for writing

If this string is empty, the writer will try to obtain the technology from the "technology" metadata attribute of the layout.

This property has been added in version 0.26.2.

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

mag_write_timestamp=

Signature: void mag_write_timestamp= (bool f)

Description: Specifies whether to write a timestamp

If this attribute is set to false, the timestamp written is 0. This is not permitted in the strict sense, but simplifies comparison of Magic files.

This property has been added in version 0.26.2.

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

mag_write_timestamp?

Signature: [const] bool mag_write_timestamp?

Description: Gets a value indicating whether to write a timestamp

See write_timestamp= method for a description of this attribute.

This property has been added in version 0.26.2.

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

new

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

no_empty_cells=

Signature: 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.

no_empty_cells?

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

oasis_compression_level

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

oasis_compression_level=

Signature: 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 further neighbor distances. The higher the level, the higher the memory requirements and run times.

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

oasis_permissive=

Signature: void oasis_permissive= (bool flag)

Description: Sets OASIS permissive mode

If this flag is true, certain shapes which cannot be written to OASIS are reported as warnings, not as errors. For example, paths with odd width (are rounded) or polygons with less than three points (are skipped).

This method has been introduced in version 0.25.1.

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

oasis_permissive?

Signature: [const] bool oasis_permissive?

Description: Gets the OASIS permissive mode

See oasis_permissive= method for a description of this predicate. This method has been introduced in version 0.25.1.

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

oasis_recompress=

Signature: void oasis_recompress= (bool flag)

Description: Sets 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.

This method has been introduced in version 0.23.

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

oasis_recompress?

Signature: [const] bool oasis_recompress?

Description: Gets the OASIS recompression mode

See oasis_recompress= method for a description of this predicate. This method has been introduced in version 0.23.

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

oasis_strict_mode=

Signature: 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.

oasis_strict_mode?

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

oasis_substitution_char

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

oasis_substitution_char=

Signature: 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.

oasis_write_cblocks=

Signature: 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.

oasis_write_cblocks?

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

oasis_write_cell_bounding_boxes=

Signature: void oasis_write_cell_bounding_boxes= (bool flag)

Description: Sets a value indicating whether cell bounding boxes are written

If this value is set to true, cell bounding boxes are written (S_BOUNDING_BOX). The S_BOUNDING_BOX properties will be attached to the CELLNAME records.

Setting this value to true will also enable writing of other standard properties like S_TOP_CELL (see oasis_write_std_properties=). By default, cell bounding boxes are not written, but standard properties are.

This method has been introduced in version 0.24.3.

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

oasis_write_cell_bounding_boxes?

Signature: [const] bool oasis_write_cell_bounding_boxes?

Description: Gets a value indicating whether cell bounding boxes are written

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

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

oasis_write_std_properties=

Signature: void oasis_write_std_properties= (bool flag)

Description: Sets a value indicating whether standard properties will be written

If this value is false, no standard properties are written. If true, S_TOP_CELL and some other global standard properties are written. In addition, oasis_write_cell_bounding_boxes= can be used to write cell bounding boxes using S_BOUNDING_BOX.

By default, this flag is true and standard properties are written.

Setting this property to false clears the oasis_write_cell_bounding_boxes flag too.

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.

oasis_write_std_properties?

Signature: [const] bool oasis_write_std_properties?

Description: Gets a value indicating whether standard properties will 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.

scale_factor

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

scale_factor=

Signature: 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.

select_all_cells

Signature: 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.

select_all_layers

Signature: 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.

select_cell

Signature: 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.

select_this_cell

Signature: 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.

set_format_from_filename

Signature: 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.

write_context_info=

Signature: 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.

write_context_info?

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