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 like 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
134 135 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 134 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
The elements of an instance path can be accessed like an array.
54 55 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 54 def [](index) end |
#each {|Sketchup::Entity| ... } ⇒ nil
The yielded entities will start with the root and end with the leaf.
75 76 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 75 def each end |
#empty? ⇒ Boolean
93 94 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 93 def empty? end |
#include?(object) ⇒ Boolean
Returns ‘true` if the instance path contain the given object.
114 115 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 114 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.
155 156 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 155 def leaf end |
#length ⇒ Integer
176 177 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 176 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.
196 197 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 196 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`.
215 216 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 215 def root end |
#size ⇒ Integer
235 236 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 235 def size end |
#to_a ⇒ Array
Returns an array representing the instance path.
251 252 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 251 def to_a end |
#transformation ⇒ Geom::Transformation #transformation(index) ⇒ Geom::Transformation
280 281 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 280 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.
300 301 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb', line 300 def valid? end |