Class: Sketchup::Layers
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb
Overview
The Layers collection allows you to see and manage all of the layers in a model. You get a pointer to the Layers object from within the Model.
Instance Method Summary collapse
-
#[](index_or_name) ⇒ Sketchup::Layer?
The #[] method is used to retrieve a layer by index or name.
-
#add(layer_name) ⇒ Object
The add method is used to add a new layer.
-
#add_observer(observer) ⇒ Object
The add_observer method is used to add an observer to the layers collection.
- #at(index_or_name) ⇒ Sketchup::Layer?
-
#count ⇒ Object
Integer - the number of layers in the collection.
-
#each {|layer| ... } ⇒ Object
The each method is used to iterate through all of the layers.
-
#length ⇒ Integer
The #length method retrieves the number of layers.
-
#purge_unused ⇒ Object
The purged_unused method is used to remove unused layers.
-
#remove(layer, remove_geometry = false) ⇒ Object
Remove the given layer from the model, optionally removing the geometry.
-
#remove_observer(observer) ⇒ Object
The remove_observer method is used to remove an observer from the current object.
- #size ⇒ Integer
-
#unique_name(base_name) ⇒ Object
The unique_name method can be used to get a string that will be a unique layer name inside this collection.
Methods inherited from Entity
#attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #set_attribute, #to_s, #typename, #valid?
Instance Method Details
#[](index_or_name) ⇒ Sketchup::Layer?
The #[] method is used to retrieve a layer by index or name.
38 39 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 38 def [](index_or_name) end |
#add(layer_name) ⇒ Object
The add method is used to add a new layer.
If you give the name of a Layer that is already defined, it will return the existing Layer rather than adding a new one.
56 57 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 56 def add(layer_name) end |
#add_observer(observer) ⇒ Object
The add_observer method is used to add an observer to the layers collection.
71 72 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 71 def add_observer(observer) end |
#at(index_or_name) ⇒ Sketchup::Layer?
88 89 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 88 def at(index_or_name) end |
#count ⇒ Object
105 106 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 105 def count end |
#each {|layer| ... } ⇒ Object
The each method is used to iterate through all of the layers.
119 120 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 119 def each end |
#length ⇒ Integer
The #length method retrieves the number of layers.
133 134 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 133 def length end |
#purge_unused ⇒ Object
The purged_unused method is used to remove unused layers.
145 146 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 145 def purge_unused end |
#remove(layer, remove_geometry = false) ⇒ Object
Remove the given layer from the model, optionally removing the geometry.
178 179 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 178 def remove(layer, remove_geometry = false) end |
#remove_observer(observer) ⇒ Object
The remove_observer method is used to remove an observer from the current object.
194 195 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 194 def remove_observer(observer) end |
#size ⇒ Integer
208 209 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 208 def size end |
#unique_name(base_name) ⇒ Object
The unique_name method can be used to get a string that will be a unique layer name inside this collection.
228 229 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb', line 228 def unique_name(base_name) end |