Class: Sketchup::Layers
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.
↑ #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.
↑ #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
↑ #each {|layer| ... } ⇒ Object
The each method is used to iterate through all of the 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.
↑ #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.