Class: Sketchup::InstancePath
- Inherits:
-
Object
- Object
- Sketchup::InstancePath
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb
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 {|Sketchup::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
137 138 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 137 def initialize(path) end |
Instance Method Details
#==(other) ⇒ Boolean
Returns ‘true` if the instances paths represent the same set of entities.
30 31 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 30 def ==(other) end |
#[](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.
57 58 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 57 def [](index) end |
#each {|Sketchup::Entity| ... } ⇒ nil
The yielded entities will start with the root and end with the leaf.
78 79 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 78 def each end |
#empty? ⇒ Boolean
96 97 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 96 def empty? end |
#include?(object) ⇒ Boolean
Returns ‘true` if the instance path contain the given object.
117 118 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 117 def include?(object) end |
#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.
158 159 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 158 def leaf end |
#length ⇒ Integer
179 180 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 179 def length end |
#persistent_id_path ⇒ String
The serialized version of an instance path is the persistent ids of its entities concatenated with a period.
199 200 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 199 def persistent_id_path end |
#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`.
218 219 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 218 def root end |
#size ⇒ Integer
238 239 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 238 def size end |
#to_a ⇒ Array
Returns an array representing the instance path.
254 255 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 254 def to_a end |
#transformation ⇒ Geom::Transformation #transformation(index) ⇒ Geom::Transformation
283 284 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 283 def transformation(*args) end |
#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.
303 304 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 303 def valid? end |