Class: Sketchup::Layers
Relationships | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Entity
|
|
Instance Chain:
self,
Enumerable,
Entity
|
|
Inherits: |
Sketchup::Entity
|
Overview
Instance Attribute Summary
Entity
- Inherited
Instance Method Summary
-
#[](index_or_name) ⇒ Sketchup::Layer?
The #[] method is used to retrieve a layer by index or name.
-
#add(layer_name) ⇒ Sketchup::Layer
(also: #add_layer)
The #add method is used to add a new layer.
-
#add_folder(name) ⇒ Sketchup::LayerFolder
The #add_folder method adds or moves a layer folder.
-
#add_layer(layer_name)
Alias for #add.
-
#add_observer(observer) ⇒ Boolean
The #add_observer method is used to add an observer to the layers collection.
- #at(index_or_name) ⇒ Sketchup::Layer?
- #count ⇒ Object
-
#count_folders ⇒ Integer
The #count_folders method counts the number of folders which are direct children of the layer manager.
-
#count_layers ⇒ Integer
The #count_layers method retrieves the number of layers not in a folder.
-
#each {|layer| ... }
The #each method is used to iterate through all of the layers in the model.
-
#each_folder {|folder| ... }
The #each_folder method is used to iterate through the folders that are direct children to the layer manager.
-
#each_layer {|layer| ... }
The #each_layer method is used to iterate through the layers that are not inside a layer folder.
-
#folders ⇒ Array<Sketchup::LayerFolder>
The #folders method returns the folders of the layer manager.
-
#layers ⇒ Array<Sketchup::Layer>
The #layers method retrieves the layers not in a folder.
-
#length ⇒ Integer
The #length method retrieves the number of layers.
-
#purge_unused ⇒ Integer
(also: #purge_unused_layers)
The #purge_unused method is used to remove unused layers.
-
#purge_unused_folders {|folder| ... }
The #purge_unused_folders method is used to remove all layer folder with no children.
-
#purge_unused_layers
Alias for #purge_unused.
-
#remove(layer, remove_geometry = false) ⇒ Boolean
(also: #remove_layer)
Remove the given layer from the model, optionally removing the geometry.
-
#remove_folder(folder) ⇒ nil
The #remove_folder method removes the folder from the model.
-
#remove_layer(layer, remove_geometry = false)
Alias for #remove.
-
#remove_observer(observer) ⇒ Boolean
The #remove_observer method is used to remove an observer from the current object.
- #size ⇒ Integer
-
#unique_name ⇒ String
The #unique_name method can be used to get a string that will be a unique layer name inside this collection.
Entity
- Inherited
#add_observer | The add_observer method is used to add an observer to the current object. |
#attribute_dictionaries | The attribute_dictionaries method is used to retrieve the |
#attribute_dictionary | The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an |
#delete_attribute | The |
#entityID | The entityID method is used to retrieve a unique ID assigned to an entity. |
#get_attribute | The |
#inspect | The |
#model | The model method is used to retrieve the model for the entity. |
#parent | The parent method is used to retrieve the parent of the entity. |
#persistent_id | The |
#remove_observer | The remove_observer method is used to remove an observer from the current object. |
#set_attribute | The set attribute is used to set the value of an attribute in an attribute dictionary with the given name. |
#to_s | The |
#typename | The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”. |
Instance Method Details
#[](index_or_name) ⇒ Sketchup::Layer?
The #[]
method is used to retrieve a layer by index or name.
#add(layer_name) ⇒ Sketchup::Layer Also known as: #add_layer
#add_folder(name) ⇒ Sketchup::LayerFolder
#add_folder(folder) ⇒ Sketchup::LayerFolder
The #add_folder
method adds or moves a layer folder.
#add_layer(layer_name)
Alias for #add.
#add_observer(observer) ⇒ Boolean
The #add_observer
method is used to add an observer to the layers collection.
#at(index_or_name) ⇒ Sketchup::Layer?
The #at
method is an alias for #[].
#count ⇒ Object
Since SketchUp 2014 the count method is inherited from Ruby’s Enumerable
mix-in module. Prior to that the #count
method is an alias for #length.
#count_folders ⇒ Integer
The #count_folders
method counts the number of folders which are direct children of the layer manager.
#count_layers ⇒ Integer
The #count_layers
method retrieves the number of layers not in a folder.
#each {|layer| ... }
Don’t remove content from this collection while iterating over it with #each
. This would change the size of the collection and cause elements to be skipped as the indices change. Instead copy the current collection to an array using to_a
and then use each
on the array, when removing content.
The #each
method is used to iterate through all of the layers in the model. This include layers that are nested inside folders.
#each_folder {|folder| ... }
The #each_folder
method is used to iterate through the folders that are direct children to the layer manager.
#each_layer {|layer| ... }
The #each_layer
method is used to iterate through the layers that are not inside a layer folder.
#folders ⇒ Array<Sketchup::LayerFolder>
This does not return all the folders in the model, only those that are direct children of the layer manager.
The #folders
method returns the folders of the layer manager.
#layers ⇒ Array<Sketchup::Layer>
The #layers
method retrieves the layers not in a folder.
#length ⇒ Integer
The #length
method retrieves the number of layers.
#purge_unused ⇒ Integer
Also known as: #purge_unused_layers
The #purge_unused
method is used to remove unused layers.
#purge_unused_folders {|folder| ... }
The #purge_unused_folders
method is used to remove all layer folder with no children.
#purge_unused_layers
Alias for #purge_unused.
#remove(layer, remove_geometry = false) ⇒ Boolean
Also known as: #remove_layer
Remove the given layer from the model, optionally removing the geometry.
#remove_folder(folder) ⇒ nil
The #remove_folder
method removes the folder from the model. All children are preserved, but moved up one level.
#remove_layer(layer, remove_geometry = false)
Alias for #remove.
#remove_observer(observer) ⇒ Boolean
The #remove_observer
method is used to remove an observer from the current object.
#size ⇒ Integer
The #size
method is an alias of #length.
The #unique_name
method can be used to get a string that will be a unique layer name inside this collection.