Class: Layout::Layers
- Inherits:
-
Object
- Object
- Layout::Layers
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Layout/Layers.rb
Overview
The Layers class is a container class for all layers in a Document.
Instance Method Summary collapse
- #[](index) ⇒ Layout::Layer
- #active ⇒ Layout::Layer
- #active=(layer) ⇒ Object
- #add(*args) ⇒ Object
- #each {|layer| ... } ⇒ Object
- #index(layer) ⇒ Integer?
- #length ⇒ Integer (also: #size)
- #remove(*args) ⇒ Object
- #reorder(layer, new_index) ⇒ Object
Instance Method Details
#[](index) ⇒ Layout::Layer
The #[] method returns a value from the array of Layout::Layers.
39 40 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 39 def [](index) end |
#active ⇒ Layout::Layer
The #active method returns the active Layout::Layer in the Document.
52 53 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 52 def active end |
#active=(layer) ⇒ Layout::Layer #active=(index) ⇒ Layout::Layer
The #active= method sets the active Layout::Layer that will be displayed the next time the Document is opened. This value will change whenever the Layout::Layer is changed in the Document in LayOut.
85 86 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 85 def active=(layer) end |
#add(shared = false) ⇒ Layout::Layer #add(name, shared = false) ⇒ Layout::Layer
The #add method adds a new Layout::Layer to the Document. The newly added Layout::Layer will be the last one in the Document.
110 111 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 110 def add(*args) end |
#each {|layer| ... } ⇒ Object
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 iterates through all of the Layout::Layers.
130 131 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 130 def each end |
#index(layer) ⇒ Integer?
The #index method returns the index of the Layout::Layer, or nil
if it doesn’t exist in the Document.
146 147 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 146 def index(layer) end |
#length ⇒ Integer Also known as: size
The #length method returns the number of Layout::Layers.
159 160 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 159 def length end |
#remove(layer, delete_entities = false) ⇒ Object #remove(index, delete_entities = false) ⇒ Object
The #remove method deletes the given Layout::Layer from the Document.
193 194 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 193 def remove(*args) end |
#reorder(layer, new_index) ⇒ Object #reorder(index, new_index) ⇒ Object
The #reorder method moves a Layout::Layer to a different index within the Document‘s list of layers. This will move the Layout::Layer such that its new index becomes new_index.
222 223 |
# File 'lib/sketchup-api-stubs/stubs/Layout/Layers.rb', line 222 def reorder(layer, new_index) end |