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

API reference - Class Shape

Notation used in Ruby API documentation

Module: db

Description: An object representing a shape in the layout database

The shape proxy is basically a pointer to a shape of different kinds. No copy of the shape is created: if the shape proxy is copied the copy still points to the original shape. If the original shape is modified or deleted, the shape proxy will also point to a modified or invalid shape. The proxy can be "null" which indicates an invalid reference.

Shape objects are used together with the Shapes container object which stores the actual shape objects and uses Shape references as pointers inside the actual data storage. Shape references are used in various places, i.e. when removing or transforming objects inside a Shapes container.

Public constructors

new Shape ptrnewCreates a new object of this class

Public methods

[const]bool!=(const Shape other)Inequality operator
[const]bool<(const Shape other)Less operator
[const]bool==(const Shape other)Equality operator
[const]Shape ptr_const_castReturns a non-const reference to self.
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]longareaReturns the area of the shape
[const]DTransarray_dtransGets the array instance member transformation in micrometer units
[const]Transarray_transGets the array instance member transformation
voidassign(const Shape other)Assigns another object to self
[const]BoxbboxReturns the bounding box of the shape
[const]variantboxGets the box object
voidbox=(const Box box)Replaces the shape by the given box
voidbox=(const DBox box)Replaces the shape by the given box (in micrometer units)
[const]Pointbox_centerReturns the center of the box
voidbox_center=(const Point c)Sets the center of the box
voidbox_center=(const DPoint c)Sets the center of the box with the point being given in micrometer units
[const]DPointbox_dcenterReturns the center of the box as a DPoint object in micrometer units
voidbox_dcenter=(const DPoint c)Sets the center of the box with the point being given in micrometer units
[const]doublebox_dheightReturns the height of the box in micrometer units
voidbox_dheight=(double h)Sets the height of the box
[const]DPointbox_dp1Returns the lower left point of the box as a DPoint object in micrometer units
voidbox_dp1=(const DPoint p)Sets the lower left corner of the box with the point being given in micrometer units
[const]DPointbox_dp2Returns the upper right point of the box as a DPoint object in micrometer units
voidbox_dp2=(const DPoint p)Sets the upper right corner of the box with the point being given in micrometer units
[const]doublebox_dwidthReturns the width of the box in micrometer units
voidbox_dwidth=(double w)Sets the width of the box in micrometer units
[const]intbox_heightReturns the height of the box
voidbox_height=(int h)Sets the height of the box
[const]Pointbox_p1Returns the lower left point of the box
voidbox_p1=(const Point p)Sets the lower left point of the box
voidbox_p1=(const DPoint p)Sets the lower left corner of the box with the point being given in micrometer units
[const]Pointbox_p2Returns the upper right point of the box
voidbox_p2=(const Point p)Sets the upper right point of the box
voidbox_p2=(const DPoint p)Sets the upper right corner of the box with the point being given in micrometer units
[const]intbox_widthReturns the width of the box
voidbox_width=(int w)Sets the width of the box
Cell ptrcellGets a reference to the cell the shape belongs to
voidcell=(Cell ptr cell)Moves the shape to a different cell
[const]doubledareaReturns the area of the shape in square micrometer units
[const]DBoxdbboxReturns the bounding box of the shape in micrometer units
[const]variantdboxGets the box object in micrometer units
voiddbox=(const DBox box)Replaces the shape by the given box (in micrometer units)
[const]variantdedgeReturns the edge object as a DEdge object in micrometer units
voiddedge=(const DEdge edge)Replaces the shape by the given edge (in micrometer units)
[const]variantdedge_pairReturns the edge pair object as a DEdgePair object in micrometer units
voiddedge_pair=(const DEdgePair edge_pair)Replaces the shape by the given edge pair (in micrometer units)
voiddeleteDeletes the shape
voiddelete_property(variant key)Deletes the user property with the given key
[const]variantdpathReturns the path object as a DPath object in micrometer units
voiddpath=(const DPath path)Replaces the shape by the given path (in micrometer units)
[const]doubledperimeterReturns the perimeter of the shape in micrometer units
[const]variantdpointReturns the point object as a DPoint object in micrometer units
voiddpoint=(const DPoint point)Replaces the shape by the given point (in micrometer units)
[const]variantdpolygonReturns the polygon object in micrometer units
voiddpolygon=(const DPolygon polygon)Replaces the shape by the given polygon (in micrometer units)
[const]variantdrectangleGets the rectangle in micron units if the object represents one or nil if not
[const]variantdsimple_polygonReturns the simple polygon object in micrometer units
voiddsimple_polygon=(const DSimplePolygon polygon)Replaces the shape by the given simple polygon (in micrometer units)
[const]variantdtextReturns the path object as a DText object in micrometer units
voiddtext=(const DText text)Replaces the shape by the given text (in micrometer units)
[const]new Shape ptrdupCreates a copy of self
[const,iter]DEdgeeach_dedgeIterates over the edges of the object and returns edges in micrometer units
[const,iter]DEdgeeach_dedge(unsigned int contour)Iterates over the edges of a single contour of the object and returns edges in micrometer units
[const,iter]DPointeach_dpointIterates over all points of the object and returns points in micrometer units
[const,iter]DPointeach_dpoint_hole(unsigned int hole_index)Iterates over a hole contour of the object and returns points in micrometer units
[const,iter]DPointeach_dpoint_hullIterates over the hull contour of the object and returns points in micrometer units
[const,iter]Edgeeach_edgeIterates over the edges of the object
[const,iter]Edgeeach_edge(unsigned int contour)Iterates over the edges of a single contour of the object
[const,iter]Pointeach_pointIterates over all points of the object
[const,iter]Pointeach_point_hole(unsigned int hole_index)Iterates over the points of a hole contour
[const,iter]Pointeach_point_hullIterates over the hull contour of the object
[const]variantedgeReturns the edge object
voidedge=(const Edge edge)Replaces the shape by the given edge
voidedge=(const DEdge edge)Replaces the shape by the given edge (in micrometer units)
[const]variantedge_pairReturns the edge pair object
voidedge_pair=(const EdgePair edge_pair)Replaces the shape by the given edge pair
voidedge_pair=(const DEdgePair edge_pair)Replaces the shape by the given edge pair (in micrometer units)
[const]boolhas_prop_id?Returns true, if the shape has properties, i.e. has a properties ID
[const]unsigned longhashHash function
[const]unsigned intholesReturns the number of holes
[const]boolis_array_member?Returns true, if the shape is a member of a shape array
[const]boolis_box?Returns true if the shape is a box
[const]boolis_edge?Returns true, if the object is an edge
[const]boolis_edge_pair?Returns true, if the object is an edge pair
[const]boolis_null?Returns true, if the shape reference is a null reference (not referring to a shape)
[const]boolis_path?Returns true, if the shape is a path
[const]boolis_point?Returns true, if the object is an point
[const]boolis_polygon?Returns true, if the shape is a polygon
[const]boolis_simple_polygon?Returns true, if the shape is a simple polygon
[const]boolis_text?Returns true, if the object is a text
[const]boolis_user_object?Returns true if the shape is a user defined object
[const]boolis_valid?Returns true, if the shape is valid
[const]unsigned intlayerReturns the layer index of the layer the shape is on
voidlayer=(unsigned int layer_index)Moves the shape to a layer given by the layer index object
[const]LayerInfolayer_infoReturns the LayerInfo object of the layer the shape is on
voidlayer_info=(const LayerInfo layer_info)Moves the shape to a layer given by a LayerInfo object
Layout ptrlayoutGets a reference to the Layout the shape belongs to
[const]variantpathReturns the path object
voidpath=(const Path box)Replaces the shape by the given path object
voidpath=(const DPath path)Replaces the shape by the given path (in micrometer units)
[const]intpath_bgnextGets the path's starting vertex extension
voidpath_bgnext=(int e)Sets the path's starting vertex extension
[const]doublepath_dbgnextGets the path's starting vertex extension in micrometer units
voidpath_dbgnext=(double e)Sets the path's starting vertex extension in micrometer units
[const]doublepath_dendextGets the path's end vertex extension in micrometer units
voidpath_dendext=(double e)Sets the path's end vertex extension in micrometer units
[const]doublepath_dlengthReturns the length of the path in micrometer units
[const]doublepath_dwidthGets the path width in micrometer units
voidpath_dwidth=(double w)Sets the path width in micrometer units
[const]intpath_endextObtain the path's end vertex extension
voidpath_endext=(int e)Sets the path's end vertex extension
[const]intpath_lengthReturns the length of the path
[const]intpath_widthGets the path width
voidpath_width=(int w)Sets the path width
[const]unsigned longperimeterReturns the perimeter of the shape
[const]variantpointReturns the point object
voidpoint=(const Point point)Replaces the shape by the given point
voidpoint=(const DPoint point)Replaces the shape by the given point (in micrometer units)
[const]variantpolygonReturns the polygon object
voidpolygon=(const Polygon box)Replaces the shape by the given polygon object
voidpolygon=(const DPolygon polygon)Replaces the shape by the given polygon (in micrometer units)
[const]unsigned longprop_idGets the properties ID associated with the shape
voidprop_id=(unsigned long id)Sets the properties ID of this shape
[const]variantpropertiesGets the user properties
[const]variantproperty(variant key)Gets the user property with the given key
[const]variantrectangleGets the rectangle if the object represents one or nil if not
voidround_path=(bool r)The path will be a round-ended path if this property is set to true
[const]boolround_path?Returns true, if the path has round ends
voidset_property(variant key,
variant value)
Sets the user property with the given key to the given value
Shapes ptrshapesGets a reference to the Shapes container the shape lives in
[const]variantsimple_polygonReturns the simple polygon object
voidsimple_polygon=(const SimplePolygon polygon)Replaces the shape by the given simple polygon object
voidsimple_polygon=(const DSimplePolygon polygon)Replaces the shape by the given simple polygon (in micrometer units)
[const]varianttextReturns the text object
voidtext=(const Text box)Replaces the shape by the given text object
voidtext=(const DText text)Replaces the shape by the given text (in micrometer units)
[const]DVectortext_dposGets the text's position in micrometer units
voidtext_dpos=(const DVector p)Sets the text's position in micrometer units
[const]doubletext_dsizeGets the text size in micrometer units
voidtext_dsize=(double size)Sets the text size in micrometer units
[const]DTranstext_dtransGets the text transformation in micrometer units
voidtext_dtrans=(const DTrans trans)Sets the text transformation in micrometer units
[const]inttext_fontGets the text's font
voidtext_font=(int font)Sets the text's font
[const]inttext_halignGets the text's horizontal alignment
voidtext_halign=(int a)Sets the text's horizontal alignment
[const]Vectortext_posGets the text's position
voidtext_pos=(const Vector p)Sets the text's position
voidtext_pos=(const DVector p)Sets the text's position in micrometer units
[const]inttext_rotGets the text's orientation code (see Trans)
voidtext_rot=(int o)Sets the text's orientation code (see Trans)
[const]inttext_sizeGets the text size
voidtext_size=(int size)Sets the text size
[const]stringtext_stringObtain the text string
voidtext_string=(string string)Sets the text string
[const]Transtext_transGets the text transformation
voidtext_trans=(const Trans trans)Sets the text transformation
voidtext_trans=(const DTrans trans)Sets the text transformation in micrometer units
[const]inttext_valignGets the text's vertical alignment
voidtext_valign=(int a)Sets the text's vertical alignment
[const]stringto_sCreate a string showing the contents of the reference
voidtransform(const Trans trans)Transforms the shape with the given transformation
voidtransform(const DTrans trans)Transforms the shape with the given transformation, given in micrometer units
voidtransform(const ICplxTrans trans)Transforms the shape with the given complex transformation
voidtransform(const DCplxTrans trans)Transforms the shape with the given complex transformation, given in micrometer units
[const]inttypeReturn the type of the shape

Public static methods and constants

intTBox
intTBoxArray
intTBoxArrayMember
intTEdge
intTEdgePair
intTNull
intTPath
intTPathPtrArray
intTPathPtrArrayMember
intTPathRef
intTPoint
intTPolygon
intTPolygonPtrArray
intTPolygonPtrArrayMember
intTPolygonRef
intTShortBox
intTShortBoxArray
intTShortBoxArrayMember
intTSimplePolygon
intTSimplePolygonPtrArray
intTSimplePolygonPtrArrayMember
intTSimplePolygonRef
intTText
intTTextPtrArray
intTTextPtrArrayMember
intTTextRef
intTUserObject

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]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead
[static]intt_boxUse of this method is deprecated. Use TBox instead
[static]intt_box_arrayUse of this method is deprecated. Use TBoxArray instead
[static]intt_box_array_memberUse of this method is deprecated. Use TBoxArrayMember instead
[static]intt_edgeUse of this method is deprecated. Use TEdge instead
[static]intt_edge_pairUse of this method is deprecated. Use TEdgePair instead
[static]intt_nullUse of this method is deprecated. Use TNull instead
[static]intt_pathUse of this method is deprecated. Use TPath instead
[static]intt_path_ptr_arrayUse of this method is deprecated. Use TPathPtrArray instead
[static]intt_path_ptr_array_memberUse of this method is deprecated. Use TPathPtrArrayMember instead
[static]intt_path_refUse of this method is deprecated. Use TPathRef instead
[static]intt_pointUse of this method is deprecated. Use TPoint instead
[static]intt_polygonUse of this method is deprecated. Use TPolygon instead
[static]intt_polygon_ptr_arrayUse of this method is deprecated. Use TPolygonPtrArray instead
[static]intt_polygon_ptr_array_memberUse of this method is deprecated. Use TPolygonPtrArrayMember instead
[static]intt_polygon_refUse of this method is deprecated. Use TPolygonRef instead
[static]intt_short_boxUse of this method is deprecated. Use TShortBox instead
[static]intt_short_box_arrayUse of this method is deprecated. Use TShortBoxArray instead
[static]intt_short_box_array_memberUse of this method is deprecated. Use TShortBoxArrayMember instead
[static]intt_simple_polygonUse of this method is deprecated. Use TSimplePolygon instead
[static]intt_simple_polygon_ptr_arrayUse of this method is deprecated. Use TSimplePolygonPtrArray instead
[static]intt_simple_polygon_ptr_array_memberUse of this method is deprecated. Use TSimplePolygonPtrArrayMember instead
[static]intt_simple_polygon_refUse of this method is deprecated. Use TSimplePolygonRef instead
[static]intt_textUse of this method is deprecated. Use TText instead
[static]intt_text_ptr_arrayUse of this method is deprecated. Use TTextPtrArray instead
[static]intt_text_ptr_array_memberUse of this method is deprecated. Use TTextPtrArrayMember instead
[static]intt_text_refUse of this method is deprecated. Use TTextRef instead
[static]intt_user_objectUse of this method is deprecated. Use TUserObject instead

Detailed description

!=

Signature: [const] bool != (const Shape other)

Description: Inequality operator

<

Signature: [const] bool < (const Shape other)

Description: Less operator

The less operator implementation is based on pointers and not strictly reproducible.However, it is good enough so Shape objects can serve as keys in hashes (see also hash).

This method has been introduced in version 0.29.1.

==

Signature: [const] bool == (const Shape other)

Description: Equality operator

Equality of shapes is not specified by the identity of the objects but by the identity of the pointers - both shapes must refer to the same object.

TBox

Signature: [static] int TBox

Description:

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

TBoxArray

Signature: [static] int TBoxArray

Description:

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

TBoxArrayMember

Signature: [static] int TBoxArrayMember

Description:

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

TEdge

Signature: [static] int TEdge

Description:

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

TEdgePair

Signature: [static] int TEdgePair

Description:

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

TNull

Signature: [static] int TNull

Description:

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

TPath

Signature: [static] int TPath

Description:

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

TPathPtrArray

Signature: [static] int TPathPtrArray

Description:

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

TPathPtrArrayMember

Signature: [static] int TPathPtrArrayMember

Description:

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

TPathRef

Signature: [static] int TPathRef

Description:

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

TPoint

Signature: [static] int TPoint

Description:

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

TPolygon

Signature: [static] int TPolygon

Description:

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

TPolygonPtrArray

Signature: [static] int TPolygonPtrArray

Description:

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

TPolygonPtrArrayMember

Signature: [static] int TPolygonPtrArrayMember

Description:

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

TPolygonRef

Signature: [static] int TPolygonRef

Description:

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

TShortBox

Signature: [static] int TShortBox

Description:

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

TShortBoxArray

Signature: [static] int TShortBoxArray

Description:

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

TShortBoxArrayMember

Signature: [static] int TShortBoxArrayMember

Description:

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

TSimplePolygon

Signature: [static] int TSimplePolygon

Description:

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

TSimplePolygonPtrArray

Signature: [static] int TSimplePolygonPtrArray

Description:

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

TSimplePolygonPtrArrayMember

Signature: [static] int TSimplePolygonPtrArrayMember

Description:

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

TSimplePolygonRef

Signature: [static] int TSimplePolygonRef

Description:

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

TText

Signature: [static] int TText

Description:

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

TTextPtrArray

Signature: [static] int TTextPtrArray

Description:

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

TTextPtrArrayMember

Signature: [static] int TTextPtrArrayMember

Description:

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

TTextRef

Signature: [static] int TTextRef

Description:

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

TUserObject

Signature: [static] int TUserObject

Description:

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

_const_cast

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

area

Signature: [const] long area

Description: Returns the area of the shape

This method has been added in version 0.22.

array_dtrans

Signature: [const] DTrans array_dtrans

Description: Gets the array instance member transformation in micrometer units

This attribute is valid only if is_array_member? is true. The transformation returned describes the relative transformation of the array member addressed. The displacement is given in micrometer units.

This method has been added in version 0.25.

array_trans

Signature: [const] Trans array_trans

Description: Gets the array instance member transformation

This attribute is valid only if is_array_member? is true. The transformation returned describes the relative transformation of the array member addressed.

assign

Signature: void assign (const Shape other)

Description: Assigns another object to self

bbox

Signature: [const] Box bbox

Description: Returns the bounding box of the shape

box

Signature: [const] variant box

Description: Gets the box object

Starting with version 0.23, this method returns nil, if the shape does not represent a box.

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

box=

(1) Signature: void box= (const Box box)

Description: Replaces the shape by the given box

This method replaces the shape by the given box. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

(2) Signature: void box= (const DBox box)

Description: Replaces the shape by the given box (in micrometer units)

This method replaces the shape by the given box, like box= with a Box argument does. This version translates the box from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

box_center

Signature: [const] Point box_center

Description: Returns the center of the box

Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

box_center=

(1) Signature: void box_center= (const Point c)

Description: Sets the center of the box

Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

(2) Signature: void box_center= (const DPoint c)

Description: Sets the center of the box with the point being given in micrometer units

Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.

This method has been introduced in version 0.25.

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

box_dcenter

Signature: [const] DPoint box_dcenter

Description: Returns the center of the box as a DPoint object in micrometer units

Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box. Conversion from database units to micrometers is done internally.

This method has been introduced in version 0.25.

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

box_dcenter=

Signature: void box_dcenter= (const DPoint c)

Description: Sets the center of the box with the point being given in micrometer units

Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.

This method has been introduced in version 0.25.

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

box_dheight

Signature: [const] double box_dheight

Description: Returns the height of the box in micrometer units

Applies to boxes only. Returns the height of the box in micrometers and throws an exception if the shape is not a box.

This method has been introduced in version 0.25.

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

box_dheight=

Signature: void box_dheight= (double h)

Description: Sets the height of the box

Applies to boxes only. Changes the height of the box to the value given in micrometer units and throws an exception if the shape is not a box. Translation to database units happens internally.

This method has been introduced in version 0.25.

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

box_dp1

Signature: [const] DPoint box_dp1

Description: Returns the lower left point of the box as a DPoint object in micrometer units

Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box. Conversion from database units to micrometers is done internally.

This method has been introduced in version 0.25.

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

box_dp1=

Signature: void box_dp1= (const DPoint p)

Description: Sets the lower left corner of the box with the point being given in micrometer units

Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.

This method has been introduced in version 0.25.

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

box_dp2

Signature: [const] DPoint box_dp2

Description: Returns the upper right point of the box as a DPoint object in micrometer units

Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box. Conversion from database units to micrometers is done internally.

This method has been introduced in version 0.25.

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

box_dp2=

Signature: void box_dp2= (const DPoint p)

Description: Sets the upper right corner of the box with the point being given in micrometer units

Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.

This method has been introduced in version 0.25.

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

box_dwidth

Signature: [const] double box_dwidth

Description: Returns the width of the box in micrometer units

Applies to boxes only. Returns the width of the box in micrometers and throws an exception if the shape is not a box.

This method has been introduced in version 0.25.

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

box_dwidth=

Signature: void box_dwidth= (double w)

Description: Sets the width of the box in micrometer units

Applies to boxes only. Changes the width of the box to the value given in micrometer units and throws an exception if the shape is not a box. Translation to database units happens internally.

This method has been introduced in version 0.25.

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

box_height

Signature: [const] int box_height

Description: Returns the height of the box

Applies to boxes only. Returns the height of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

box_height=

Signature: void box_height= (int h)

Description: Sets the height of the box

Applies to boxes only. Changes the height of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

box_p1

Signature: [const] Point box_p1

Description: Returns the lower left point of the box

Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

box_p1=

(1) Signature: void box_p1= (const Point p)

Description: Sets the lower left point of the box

Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

(2) Signature: void box_p1= (const DPoint p)

Description: Sets the lower left corner of the box with the point being given in micrometer units

Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.

This method has been introduced in version 0.25.

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

box_p2

Signature: [const] Point box_p2

Description: Returns the upper right point of the box

Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

box_p2=

(1) Signature: void box_p2= (const Point p)

Description: Sets the upper right point of the box

Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

(2) Signature: void box_p2= (const DPoint p)

Description: Sets the upper right corner of the box with the point being given in micrometer units

Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.

This method has been introduced in version 0.25.

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

box_width

Signature: [const] int box_width

Description: Returns the width of the box

Applies to boxes only. Returns the width of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

box_width=

Signature: void box_width= (int w)

Description: Sets the width of the box

Applies to boxes only. Changes the width of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

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

cell

Signature: Cell ptr cell

Description: Gets a reference to the cell the shape belongs to

This reference can be nil, if the Shape object is not living inside a cell

This method has been introduced in version 0.22.

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

cell=

Signature: void cell= (Cell ptr cell)

Description: Moves the shape to a different cell

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

This method has been introduced in version 0.23.

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

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

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

darea

Signature: [const] double darea

Description: Returns the area of the shape in square micrometer units

This method has been added in version 0.25.

dbbox

Signature: [const] DBox dbbox

Description: Returns the bounding box of the shape in micrometer units

This method has been added in version 0.25.

dbox

Signature: [const] variant dbox

Description: Gets the box object in micrometer units

See box for a description of this method. This method returns the box after translation to micrometer units.

This method has been added in version 0.25.

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

dbox=

Signature: void dbox= (const DBox box)

Description: Replaces the shape by the given box (in micrometer units)

This method replaces the shape by the given box, like box= with a Box argument does. This version translates the box from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

dedge

Signature: [const] variant dedge

Description: Returns the edge object as a DEdge object in micrometer units

See edge for a description of this method. This method returns the edge after translation to micrometer units.

This method has been added in version 0.25.

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

dedge=

Signature: void dedge= (const DEdge edge)

Description: Replaces the shape by the given edge (in micrometer units)

This method replaces the shape by the given edge, like edge= with a Edge argument does. This version translates the edge from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

dedge_pair

Signature: [const] variant dedge_pair

Description: Returns the edge pair object as a DEdgePair object in micrometer units

See edge_pair for a description of this method. This method returns the edge pair after translation to micrometer units.

This method has been added in version 0.26.

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

dedge_pair=

Signature: void dedge_pair= (const DEdgePair edge_pair)

Description: Replaces the shape by the given edge pair (in micrometer units)

This method replaces the shape by the given edge pair, like edge_pair= with a EdgePair argument does. This version translates the edge pair from micrometer units to database units internally.

This method has been introduced in version 0.26.

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

delete

Signature: void delete

Description: Deletes the shape

After the shape is deleted, the shape object is emptied and points to nothing.

This method has been introduced in version 0.23.

delete_property

Signature: void delete_property (variant key)

Description: Deletes the user property with the given key

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

This method has been introduced in version 0.22.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

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

destroyed?

Signature: [const] bool destroyed?

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

Use of this method is deprecated. Use _destroyed? instead

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

dpath

Signature: [const] variant dpath

Description: Returns the path object as a DPath object in micrometer units

See path for a description of this method. This method returns the path after translation to micrometer units.

This method has been added in version 0.25.

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

dpath=

Signature: void dpath= (const DPath path)

Description: Replaces the shape by the given path (in micrometer units)

This method replaces the shape by the given path, like path= with a Path argument does. This version translates the path from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

dperimeter

Signature: [const] double dperimeter

Description: Returns the perimeter of the shape in micrometer units

This method will return an approximation of the perimeter for paths.

This method has been added in version 0.25.

dpoint

Signature: [const] variant dpoint

Description: Returns the point object as a DPoint object in micrometer units

See point for a description of this method. This method returns the point after translation to micrometer units.

This method has been introduced in version 0.28.

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

dpoint=

Signature: void dpoint= (const DPoint point)

Description: Replaces the shape by the given point (in micrometer units)

This method replaces the shape by the given point, like point= with a Point argument does. This version translates the point from micrometer units to database units internally.

This method has been introduced in version 0.28.

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

dpolygon

Signature: [const] variant dpolygon

Description: Returns the polygon object in micrometer units

Returns the polygon object that this shape refers to or converts the object to a polygon. The method returns the same object than polygon, but translates it to micrometer units internally.

This method has been introduced in version 0.25.

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

dpolygon=

Signature: void dpolygon= (const DPolygon polygon)

Description: Replaces the shape by the given polygon (in micrometer units)

This method replaces the shape by the given polygon, like polygon= with a Polygon argument does. This version translates the polygon from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

drectangle

Signature: [const] variant drectangle

Description: Gets the rectangle in micron units if the object represents one or nil if not

If the shape represents a rectangle - i.e. a box or box polygon, a path with two points and no round ends - this method returns the box. If not, nil is returned.

This method has been introduced in version 0.29.

dsimple_polygon

Signature: [const] variant dsimple_polygon

Description: Returns the simple polygon object in micrometer units

Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. The method returns the same object than simple_polygon, but translates it to micrometer units internally.

This method has been introduced in version 0.25.

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

dsimple_polygon=

Signature: void dsimple_polygon= (const DSimplePolygon polygon)

Description: Replaces the shape by the given simple polygon (in micrometer units)

This method replaces the shape by the given text, like simple_polygon= with a SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

dtext

Signature: [const] variant dtext

Description: Returns the path object as a DText object in micrometer units

See text for a description of this method. This method returns the text after translation to micrometer units.

This method has been added in version 0.25.

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

dtext=

Signature: void dtext= (const DText text)

Description: Replaces the shape by the given text (in micrometer units)

This method replaces the shape by the given text, like text= with a Text argument does. This version translates the text from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

dup

Signature: [const] new Shape ptr dup

Description: Creates a copy of self

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

each_dedge

(1) Signature: [const,iter] DEdge each_dedge

Description: Iterates over the edges of the object and returns edges in micrometer units

This method iterates over all edges of polygons and simple polygons like each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally.

This method has been introduced in version 0.25.

(2) Signature: [const,iter] DEdge each_dedge (unsigned int contour)

Description: Iterates over the edges of a single contour of the object and returns edges in micrometer units

This method iterates over all edges of polygons and simple polygons like each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally.

This method has been introduced in version 0.25.

each_dpoint

Signature: [const,iter] DPoint each_dpoint

Description: Iterates over all points of the object and returns points in micrometer units

This method iterates over all points of the object like each_point, but it returns DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally.

This method has been introduced in version 0.25.

each_dpoint_hole

Signature: [const,iter] DPoint each_dpoint_hole (unsigned int hole_index)

Description: Iterates over a hole contour of the object and returns points in micrometer units

This method iterates over all points of the object's contour' like each_point_hole, but it returns DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally.

This method has been introduced in version 0.25.

each_dpoint_hull

Signature: [const,iter] DPoint each_dpoint_hull

Description: Iterates over the hull contour of the object and returns points in micrometer units

This method iterates over all points of the object's contour' like each_point_hull, but it returns DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally.

This method has been introduced in version 0.25.

each_edge

(1) Signature: [const,iter] Edge each_edge

Description: Iterates over the edges of the object

This method applies to polygons and simple polygons and delivers all edges that form the polygon's contours. Hole edges are oriented counterclockwise while hull edges are oriented clockwise.

It will throw an exception if the object is not a polygon.

(2) Signature: [const,iter] Edge each_edge (unsigned int contour)

Description: Iterates over the edges of a single contour of the object

contour:The contour number (0 for hull, 1 for first hole ...)

This method applies to polygons and simple polygons and delivers all edges that form the given contour of the polygon. The hull has contour number 0, the first hole has contour 1 etc. Hole edges are oriented counterclockwise while hull edges are oriented clockwise.

It will throw an exception if the object is not a polygon.

This method was introduced in version 0.24.

each_point

Signature: [const,iter] Point each_point

Description: Iterates over all points of the object

This method applies to paths and delivers all points of the path's center line. It will throw an exception for other objects.

each_point_hole

Signature: [const,iter] Point each_point_hole (unsigned int hole_index)

Description: Iterates over the points of a hole contour

hole:The hole index (see holes () method)

This method applies to polygons and delivers all points of the respective hole contour. It will throw an exception for other objects. Simple polygons deliver an empty sequence.

each_point_hull

Signature: [const,iter] Point each_point_hull

Description: Iterates over the hull contour of the object

This method applies to polygons and delivers all points of the polygon hull contour. It will throw an exception for other objects.

edge

Signature: [const] variant edge

Description: Returns the edge object

Starting with version 0.23, this method returns nil, if the shape does not represent an edge.

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

edge=

(1) Signature: void edge= (const Edge edge)

Description: Replaces the shape by the given edge

This method replaces the shape by the given edge. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

(2) Signature: void edge= (const DEdge edge)

Description: Replaces the shape by the given edge (in micrometer units)

This method replaces the shape by the given edge, like edge= with a Edge argument does. This version translates the edge from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

edge_pair

Signature: [const] variant edge_pair

Description: Returns the edge pair object

This method has been introduced in version 0.26.

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

edge_pair=

(1) Signature: void edge_pair= (const EdgePair edge_pair)

Description: Replaces the shape by the given edge pair

This method replaces the shape by the given edge pair. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.26.

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

(2) Signature: void edge_pair= (const DEdgePair edge_pair)

Description: Replaces the shape by the given edge pair (in micrometer units)

This method replaces the shape by the given edge pair, like edge_pair= with a EdgePair argument does. This version translates the edge pair from micrometer units to database units internally.

This method has been introduced in version 0.26.

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

has_prop_id?

Signature: [const] bool has_prop_id?

Description: Returns true, if the shape has properties, i.e. has a properties ID

hash

Signature: [const] unsigned long hash

Description: Hash function

The hash function enables Shape objects as keys in hashes.

This method has been introduced in version 0.29.1.

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

holes

Signature: [const] unsigned int holes

Description: Returns the number of holes

This method applies to polygons and will throw an exception for other objects.. Simple polygons deliver a value of zero.

is_array_member?

Signature: [const] bool is_array_member?

Description: Returns true, if the shape is a member of a shape array

is_box?

Signature: [const] bool is_box?

Description: Returns true if the shape is a box

is_const_object?

Signature: [const] bool is_const_object?

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

Use of this method is deprecated. Use _is_const_object? instead

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

is_edge?

Signature: [const] bool is_edge?

Description: Returns true, if the object is an edge

is_edge_pair?

Signature: [const] bool is_edge_pair?

Description: Returns true, if the object is an edge pair

This method has been introduced in version 0.26.

is_null?

Signature: [const] bool is_null?

Description: Returns true, if the shape reference is a null reference (not referring to a shape)

is_path?

Signature: [const] bool is_path?

Description: Returns true, if the shape is a path

is_point?

Signature: [const] bool is_point?

Description: Returns true, if the object is an point

This method has been introduced in version 0.28.

is_polygon?

Signature: [const] bool is_polygon?

Description: Returns true, if the shape is a polygon

This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the polygon method also if is_polygon? does not return true.

is_simple_polygon?

Signature: [const] bool is_simple_polygon?

Description: Returns true, if the shape is a simple polygon

This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use is_polygon? and polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes.

is_text?

Signature: [const] bool is_text?

Description: Returns true, if the object is a text

is_user_object?

Signature: [const] bool is_user_object?

Description: Returns true if the shape is a user defined object

is_valid?

Signature: [const] bool is_valid?

Description: Returns true, if the shape is valid

After the shape is deleted, the shape object is no longer valid and this method returns false.

This method has been introduced in version 0.23.

layer

Signature: [const] unsigned int layer

Description: Returns the layer index of the layer the shape is on

Throws an exception if the shape does not reside inside a cell.

This method has been added in version 0.23.

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

layer=

Signature: void layer= (unsigned int layer_index)

Description: Moves the shape to a layer given by the layer index object

This method has been added in version 0.23.

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

layer_info

Signature: [const] LayerInfo layer_info

Description: Returns the LayerInfo object of the layer the shape is on

If the shape does not reside inside a cell, an empty layer is returned.

This method has been added in version 0.23.

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

layer_info=

Signature: void layer_info= (const LayerInfo layer_info)

Description: Moves the shape to a layer given by a LayerInfo object

If no layer with the given properties exists, an exception is thrown.

This method has been added in version 0.23.

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

layout

Signature: Layout ptr layout

Description: Gets a reference to the Layout the shape belongs to

This reference can be nil, if the Shape object is not living inside a layout.

This method has been introduced in version 0.22.

new

Signature: [static] new Shape ptr new

Description: Creates a new object of this class

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

path

Signature: [const] variant path

Description: Returns the path object

Starting with version 0.23, this method returns nil, if the shape does not represent a path.

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

path=

(1) Signature: void path= (const Path box)

Description: Replaces the shape by the given path object

This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

(2) Signature: void path= (const DPath path)

Description: Replaces the shape by the given path (in micrometer units)

This method replaces the shape by the given path, like path= with a Path argument does. This version translates the path from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

path_bgnext

Signature: [const] int path_bgnext

Description: Gets the path's starting vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

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

path_bgnext=

Signature: void path_bgnext= (int e)

Description: Sets the path's starting vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.23.

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

path_dbgnext

Signature: [const] double path_dbgnext

Description: Gets the path's starting vertex extension in micrometer units

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.25.

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

path_dbgnext=

Signature: void path_dbgnext= (double e)

Description: Sets the path's starting vertex extension in micrometer units

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.25.

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

path_dendext

Signature: [const] double path_dendext

Description: Gets the path's end vertex extension in micrometer units

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.25.

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

path_dendext=

Signature: void path_dendext= (double e)

Description: Sets the path's end vertex extension in micrometer units

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.25.

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

path_dlength

Signature: [const] double path_dlength

Description: Returns the length of the path in micrometer units

Applies to paths only. Will throw an exception if the object is not a path. This method returns the length of the spine plus extensions if present. The value returned is given in micrometer units.

This method has been added in version 0.25.

path_dwidth

Signature: [const] double path_dwidth

Description: Gets the path width in micrometer units

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.25.

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

path_dwidth=

Signature: void path_dwidth= (double w)

Description: Sets the path width in micrometer units

Applies to paths only. Will throw an exception if the object is not a path. Conversion to database units is done internally.

This method has been introduced in version 0.25.

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

path_endext

Signature: [const] int path_endext

Description: Obtain the path's end vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

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

path_endext=

Signature: void path_endext= (int e)

Description: Sets the path's end vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.23.

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

path_length

Signature: [const] int path_length

Description: Returns the length of the path

Applies to paths only. Will throw an exception if the object is not a path. This method returns the length of the spine plus extensions if present.

This method has been added in version 0.23.

path_width

Signature: [const] int path_width

Description: Gets the path width

Applies to paths only. Will throw an exception if the object is not a path.

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

path_width=

Signature: void path_width= (int w)

Description: Sets the path width

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.23.

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

perimeter

Signature: [const] unsigned long perimeter

Description: Returns the perimeter of the shape

This method will return an approximation of the perimeter for paths.

This method has been added in version 0.23.

point

Signature: [const] variant point

Description: Returns the point object

This method has been introduced in version 0.28.

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

point=

(1) Signature: void point= (const Point point)

Description: Replaces the shape by the given point

This method replaces the shape by the given point. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.28.

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

(2) Signature: void point= (const DPoint point)

Description: Replaces the shape by the given point (in micrometer units)

This method replaces the shape by the given point, like point= with a Point argument does. This version translates the point from micrometer units to database units internally.

This method has been introduced in version 0.28.

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

polygon

Signature: [const] variant polygon

Description: Returns the polygon object

Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour.

Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon.

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

polygon=

(1) Signature: void polygon= (const Polygon box)

Description: Replaces the shape by the given polygon object

This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

(2) Signature: void polygon= (const DPolygon polygon)

Description: Replaces the shape by the given polygon (in micrometer units)

This method replaces the shape by the given polygon, like polygon= with a Polygon argument does. This version translates the polygon from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

prop_id

Signature: [const] unsigned long prop_id

Description: Gets the properties ID associated with the shape

The Layout object can be used to retrieve the actual properties associated with the ID.

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 of this shape

The Layout object can be used to retrieve an ID for a given set of properties. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

properties

Signature: [const] variant properties

Description: Gets the user properties

This method is a convenience method that gets the properties of the shape as a single hash.

This method has been introduced in version 0.29.5.

property

Signature: [const] variant property (variant key)

Description: Gets the user property with the given key

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

rectangle

Signature: [const] variant rectangle

Description: Gets the rectangle if the object represents one or nil if not

If the shape represents a rectangle - i.e. a box or box polygon, a path with two points and no round ends - this method returns the box. If not, nil is returned.

This method has been introduced in version 0.29.

round_path=

Signature: void round_path= (bool r)

Description: The path will be a round-ended path if this property is set to true

Applies to paths only. Will throw an exception if the object is not a path. Please note that the extensions will apply as well. To get a path with circular ends, set the begin and end extensions to half the path's width.

This method has been introduced in version 0.23.

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

round_path?

Signature: [const] bool round_path?

Description: Returns true, if the path has round ends

Applies to paths only. Will throw an exception if the object is not a path.

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

set_property

Signature: void set_property (variant key, variant value)

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

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

This method has been introduced in version 0.22.

shapes

Signature: Shapes ptr shapes

Description: Gets a reference to the Shapes container the shape lives in

This reference can be nil, if the Shape object is not referring to an actual shape.

This method has been introduced in version 0.22.

simple_polygon

Signature: [const] variant simple_polygon

Description: Returns the simple polygon object

Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon.

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

simple_polygon=

(1) Signature: void simple_polygon= (const SimplePolygon polygon)

Description: Replaces the shape by the given simple polygon object

This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

(2) Signature: void simple_polygon= (const DSimplePolygon polygon)

Description: Replaces the shape by the given simple polygon (in micrometer units)

This method replaces the shape by the given text, like simple_polygon= with a SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

t_box

Signature: [static] int t_box

Description:

Use of this method is deprecated. Use TBox instead

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

t_box_array

Signature: [static] int t_box_array

Description:

Use of this method is deprecated. Use TBoxArray instead

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

t_box_array_member

Signature: [static] int t_box_array_member

Description:

Use of this method is deprecated. Use TBoxArrayMember instead

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

t_edge

Signature: [static] int t_edge

Description:

Use of this method is deprecated. Use TEdge instead

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

t_edge_pair

Signature: [static] int t_edge_pair

Description:

Use of this method is deprecated. Use TEdgePair instead

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

t_null

Signature: [static] int t_null

Description:

Use of this method is deprecated. Use TNull instead

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

t_path

Signature: [static] int t_path

Description:

Use of this method is deprecated. Use TPath instead

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

t_path_ptr_array

Signature: [static] int t_path_ptr_array

Description:

Use of this method is deprecated. Use TPathPtrArray instead

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

t_path_ptr_array_member

Signature: [static] int t_path_ptr_array_member

Description:

Use of this method is deprecated. Use TPathPtrArrayMember instead

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

t_path_ref

Signature: [static] int t_path_ref

Description:

Use of this method is deprecated. Use TPathRef instead

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

t_point

Signature: [static] int t_point

Description:

Use of this method is deprecated. Use TPoint instead

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

t_polygon

Signature: [static] int t_polygon

Description:

Use of this method is deprecated. Use TPolygon instead

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

t_polygon_ptr_array

Signature: [static] int t_polygon_ptr_array

Description:

Use of this method is deprecated. Use TPolygonPtrArray instead

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

t_polygon_ptr_array_member

Signature: [static] int t_polygon_ptr_array_member

Description:

Use of this method is deprecated. Use TPolygonPtrArrayMember instead

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

t_polygon_ref

Signature: [static] int t_polygon_ref

Description:

Use of this method is deprecated. Use TPolygonRef instead

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

t_short_box

Signature: [static] int t_short_box

Description:

Use of this method is deprecated. Use TShortBox instead

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

t_short_box_array

Signature: [static] int t_short_box_array

Description:

Use of this method is deprecated. Use TShortBoxArray instead

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

t_short_box_array_member

Signature: [static] int t_short_box_array_member

Description:

Use of this method is deprecated. Use TShortBoxArrayMember instead

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

t_simple_polygon

Signature: [static] int t_simple_polygon

Description:

Use of this method is deprecated. Use TSimplePolygon instead

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

t_simple_polygon_ptr_array

Signature: [static] int t_simple_polygon_ptr_array

Description:

Use of this method is deprecated. Use TSimplePolygonPtrArray instead

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

t_simple_polygon_ptr_array_member

Signature: [static] int t_simple_polygon_ptr_array_member

Description:

Use of this method is deprecated. Use TSimplePolygonPtrArrayMember instead

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

t_simple_polygon_ref

Signature: [static] int t_simple_polygon_ref

Description:

Use of this method is deprecated. Use TSimplePolygonRef instead

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

t_text

Signature: [static] int t_text

Description:

Use of this method is deprecated. Use TText instead

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

t_text_ptr_array

Signature: [static] int t_text_ptr_array

Description:

Use of this method is deprecated. Use TTextPtrArray instead

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

t_text_ptr_array_member

Signature: [static] int t_text_ptr_array_member

Description:

Use of this method is deprecated. Use TTextPtrArrayMember instead

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

t_text_ref

Signature: [static] int t_text_ref

Description:

Use of this method is deprecated. Use TTextRef instead

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

t_user_object

Signature: [static] int t_user_object

Description:

Use of this method is deprecated. Use TUserObject instead

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

text

Signature: [const] variant text

Description: Returns the text object

Starting with version 0.23, this method returns nil, if the shape does not represent a text.

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

text=

(1) Signature: void text= (const Text box)

Description: Replaces the shape by the given text object

This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

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

(2) Signature: void text= (const DText text)

Description: Replaces the shape by the given text (in micrometer units)

This method replaces the shape by the given text, like text= with a Text argument does. This version translates the text from micrometer units to database units internally.

This method has been introduced in version 0.25.

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

text_dpos

Signature: [const] DVector text_dpos

Description: Gets the text's position in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been added in version 0.25.

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

text_dpos=

Signature: void text_dpos= (const DVector p)

Description: Sets the text's position in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been added in version 0.25.

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

text_dsize

Signature: [const] double text_dsize

Description: Gets the text size in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.25.

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

text_dsize=

Signature: void text_dsize= (double size)

Description: Sets the text size in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.25.

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

text_dtrans

Signature: [const] DTrans text_dtrans

Description: Gets the text transformation in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been added in version 0.25.

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

text_dtrans=

Signature: void text_dtrans= (const DTrans trans)

Description: Sets the text transformation in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.25.

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

text_font

Signature: [const] int text_font

Description: Gets the text's font

Applies to texts only. Will throw an exception if the object is not a text.

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

text_font=

Signature: void text_font= (int font)

Description: Sets the text's font

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.23.

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

text_halign

Signature: [const] int text_halign

Description: Gets the text's horizontal alignment

Applies to texts only. Will throw an exception if the object is not a text. The return value is 0 for left alignment, 1 for center alignment and 2 to right alignment.

This method has been introduced in version 0.22.

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

text_halign=

Signature: void text_halign= (int a)

Description: Sets the text's horizontal alignment

Applies to texts only. Will throw an exception if the object is not a text. See text_halign for a description of that property.

This method has been introduced in version 0.23.

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

text_pos

Signature: [const] Vector text_pos

Description: Gets the text's position

Applies to texts only. Will throw an exception if the object is not a text.

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

text_pos=

(1) Signature: void text_pos= (const Vector p)

Description: Sets the text's position

Applies to texts only. Will throw an exception if the object is not a text.

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

(2) Signature: void text_pos= (const DVector p)

Description: Sets the text's position in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been added in version 0.25.

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

text_rot

Signature: [const] int text_rot

Description: Gets the text's orientation code (see Trans)

Applies to texts only. Will throw an exception if the object is not a text.

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

text_rot=

Signature: void text_rot= (int o)

Description: Sets the text's orientation code (see Trans)

Applies to texts only. Will throw an exception if the object is not a text.

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

text_size

Signature: [const] int text_size

Description: Gets the text size

Applies to texts only. Will throw an exception if the object is not a text.

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

text_size=

Signature: void text_size= (int size)

Description: Sets the text size

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.23.

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

text_string

Signature: [const] string text_string

Description: Obtain the text string

Applies to texts only. Will throw an exception if the object is not a text.

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

text_string=

Signature: void text_string= (string string)

Description: Sets the text string

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.23.

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

text_trans

Signature: [const] Trans text_trans

Description: Gets the text transformation

Applies to texts only. Will throw an exception if the object is not a text.

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

text_trans=

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

Description: Sets the text transformation

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.23.

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

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

Description: Sets the text transformation in micrometer units

Applies to texts only. Will throw an exception if the object is not a text.

This method has been introduced in version 0.25.

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

text_valign

Signature: [const] int text_valign

Description: Gets the text's vertical alignment

Applies to texts only. Will throw an exception if the object is not a text. The return value is 0 for top alignment, 1 for center alignment and 2 to bottom alignment.

This method has been introduced in version 0.22.

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

text_valign=

Signature: void text_valign= (int a)

Description: Sets the text's vertical alignment

Applies to texts only. Will throw an exception if the object is not a text. See text_valign for a description of that property.

This method has been introduced in version 0.23.

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

to_s

Signature: [const] string to_s

Description: Create a string showing the contents of the reference

This method has been introduced with version 0.16.

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

transform

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

Description: Transforms the shape with the given transformation

This method has been introduced in version 0.23.

(2) Signature: void transform (const DTrans trans)

Description: Transforms the shape with the given transformation, given in micrometer units

This method has been introduced in version 0.25.

(3) Signature: void transform (const ICplxTrans trans)

Description: Transforms the shape with the given complex transformation

This method has been introduced in version 0.23.

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

Description: Transforms the shape with the given complex transformation, given in micrometer units

This method has been introduced in version 0.25.

type

Signature: [const] int type

Description: Return the type of the shape

The returned values are the t_... constants available through the corresponding class members.