Class: Sketchup::InstancePath
- Inherits:
-
Object
- Object
- Sketchup::InstancePath
- Includes:
- Enumerable
Overview
The InstancePath class represent the instance path to a given entity within the model hierarchy.
Instance Method Summary # collapse
-
#==(other) ⇒ Boolean
`true` if the instances paths represent the same set of entities.
-
#[](index) ⇒ Sketchup::Entity
The elements of an instance path can be accessed similarly to an array.
-
#each {|entity| ... } ⇒ nil
The yielded entities will start with the root and end with the leaf.
- #empty? ⇒ Boolean
-
#include?(object) ⇒ Boolean
Returns `true` if the instance path contain the given object.
- #initialize(path) ⇒ Sketchup::InstancePath constructor
-
#leaf ⇒ Sketchup::Entity
The leaf of an instance path is the last element which can be any entity that can be represented in the model.
- #length ⇒ Integer
-
#persistent_id_path ⇒ String
The serialized version of an instance path is the persistent ids of its entities concatenated with a period.
-
#root ⇒ Sketchup::Group, ...
The root of an instance path is the element located closest to the model root.
- #size ⇒ Integer
-
#to_a ⇒ Array
An array representing the instance path.
- #transformation(*args) ⇒ Object
-
#valid? ⇒ Boolean
An instance path is valid if it has at least one element and consist of groups and instances with exception of the leaf which can be any entity.
Constructor Details
↑ #initialize(path) ⇒ Sketchup::InstancePath
Instance Method Details
↑ #==(other) ⇒ Boolean
Returns `true` if the instances paths represent the same set of entities.
↑ #[](index) ⇒ Sketchup::Entity
This method does not accept negative indices. For the exact behavior of an array, use {#to_a}.
The elements of an instance path can be accessed similarly to an array.
↑ #each {|entity| ... } ⇒ nil
The yielded entities will start with the root and end with the leaf.
↑ #empty? ⇒ Boolean
↑ #include?(object) ⇒ Boolean
Returns `true` if the instance path contain the given object.
↑ #leaf ⇒ Sketchup::Entity
The leaf of an instance path is the last element which can be any entity that can be represented in the model. This is normally a Drawingelement, but could be a Vertex.
An instance can also be a leaf.
↑ #persistent_id_path ⇒ String
The serialized version of an instance path is the persistent ids of its entities concatenated with a period.
↑ #root ⇒ Sketchup::Group, ...
The root of an instance path is the element located closest to the model root. This will be a group or component instance. If you have a non-instance as a leaf with no other parent component this will return `nil`.
↑ #size ⇒ Integer
↑ #transformation ⇒ Geom::Transformation #transformation(index) ⇒ Geom::Transformation
↑ #valid? ⇒ Boolean
An instance path is valid if it has at least one element and consist of groups and instances with exception of the leaf which can be any entity.
This method doesn't check if the path can actually be looked up in the model.