API reference - Class ObjectInstPath

Notation used in Ruby API documentation

Description: A class describing a selected shape or instance

A shape or instance is addressed by a path which describes all instances leading to the specified object. These instances are described through InstElement objects, which describe the instance and, in case of array instances, the specific array member. For shapes, additionally the layer and the shape itself is specified. The ObjectInstPath objects encapsulates both forms, which can be distinguished with the is_cell_inst? attribute.

Public constructors

ObjectInstPathnewCreates a new object of this class

Public methods

[const]voidassign(const ObjectInstPath other)Assign the contents of another object to self
[const]unsigned intcell_indexAccessor to the cell index of the cell that the selection applies to.
voidcreateEnsures the C++ object is created
[const]unsigned intcv_indexAccessor to the cellview index that describes which cell view the shape or instance is located in
voiddestroyExplicitly destroy the object
[const]booldestroyed?Returns a value indicating whether the object was already destroyed
[const]ObjectInstPathdupCreates a copy of self
[const,iter]InstElementeach_instYield the instantiation path
[const]InstanceinstDeliver the instance represented by this selection
[const]boolis_cell_inst?True, if this selection represents a cell instance
[const]boolis_const_object?Returns a value indicating whether the reference is a const reference
[const]unsigned intlayerAccessor to the layer index that describes which layer the selected shape is on
[const]unsigned intpath_lengthReturns the length of the path (number of elements delivered by each_inst)
[const]InstElementpath_nth(unsigned int n)Returns the nth element of the path (similar to each_inst but with direct access through the index)
[const]unsigned longseqThe sequence number
[const]ShapeshapeAccessor to the shape object that describes the selected shape geometrically
[const]unsigned intsourceReturns to the cell index of the cell that the selected element resides inside.
[const]CplxTranssource_transAccessor to the transformation applicable for an instance and shape.
[const]CplxTranstransAccessor to the transformation applicable for the shape.

Detailed description

[const] void assign(const ObjectInstPath other)

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] unsigned int cell_index

Description: Accessor to the cell index of the cell that the selection applies to.

This method returns the cell index that describes which cell the selected shape is located in or the cell whose instance is selected if is_cell_inst? is true.

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.

[const] unsigned int cv_index

Description: Accessor to the cellview index that describes which cell view the shape or instance is located in

void destroy

Description: Explicitly destroy the object

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

[const] bool destroyed?

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

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

[const] ObjectInstPath dup

Description: Creates a copy of self

[const,iter] InstElement each_inst

Description: Yield the instantiation path

The instantiation path describes by an sequence of InstElement objects the path by which the cell containing the selected shape is found from the cell view's current cell. If this object represents an instance, the path will contain the selected instance as the last element. The elements are delivered top down.

[const] Instance inst

Description: Deliver the instance represented by this selection

This method delivers valid results only if is_cell_inst? is true. It returns the instance reference (an Instance object) that this selection represents. This method has been added in version 0.16.

[const] bool is_cell_inst?

Description: True, if this selection represents a cell instance

If this attribute is true, the shape reference and layer are not valid.

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

[const] unsigned int layer

Description: Accessor to the layer index that describes which layer the selected shape is on

This method delivers valid results only for object selections that represent shapes, i.e for which is_cell_inst? is false.

[static] ObjectInstPath new

Description: Creates a new object of this class

[const] unsigned int path_length

Description: Returns the length of the path (number of elements delivered by each_inst)

This method has been added in version 0.16.

[const] InstElement path_nth(unsigned int n)

Description: Returns the nth element of the path (similar to each_inst but with direct access through the index)

n:The index of the element to retrieve (0..path_length-1)

This method has been added in version 0.16.

[const] unsigned long seq

Description: The sequence number

The sequence number describes when the item was selected. A sequence number of 0 indicates that the item was selected in the first selection action (without 'Shift' pressed).

[const] Shape shape

Description: Accessor to the shape object that describes the selected shape geometrically

This method delivers valid results only for object selections that represent shapes, i.e for which is_cell_inst? is false.

[const] unsigned int source

Description: Returns to the cell index of the cell that the selected element resides inside.

If this reference represents a cell instance, this method delivers the index of the cell in which the cell instance resides. Otherwise, this method returns the same value than cell_index. This method has been added in version 0.16.

[const] CplxTrans source_trans

Description: Accessor to the transformation applicable for an instance and shape.

If this object represents a shape, this transformation describes how the selected shape is transformed into the current cell of the cell view. If this object represents an instance, this transformation describes how the selected instance is transformed into the current cell of the cell view. This method is similar to trans, except that the resulting transformation does not include the instance transformation if the object represents an instance. This method has been added in version 0.16.

[const] CplxTrans trans

Description: Accessor to the transformation applicable for the shape.

If this object represents a shape, this transformation describes how the selected shape is transformed into the current cell of the cell view. Basically, this transformation is the accumulated transformation over the instantiation path. If the ObjectInstPath represents a cell instance, this includes the transformation of the selected instance as well.