class Layout::Layer
This is the interface to a LayOut Layer
Definition. A layer definition specifies the document-wide information about a layer. To access the entities on a layer for a given page, use {Layout::LayerInstance}.
@example
# Grab a handle to an existing LayOut document. doc = Layout::Document.open("C:/path/to/document.layout") new_layer = doc.layers.add(true) new_layer.name = "A new layer"
@version LayOut 2018
Constants
- SHARELAYERACTION_CLEAR
Constants
- SHARELAYERACTION_KEEPONEPAGE
- SHARELAYERACTION_MERGEALLPAGES
- UNSHARELAYERACTION_CLEAR
- UNSHARELAYERACTION_COPYTOALLPAGES
- UNSHARELAYERACTION_COPYTOONEPAGE
Public Instance Methods
The {#==} method checks to see if the two {Layout::Layer}s are equal. This checks whether the Ruby Objects are pointing to the same internal object.
@example
doc = Layout::Document.open("C:/path/to/document.layout") document = doc.pages.first.document doc.layers.first == document.layers.first
@param [Layout::Layer] other
@return [Boolean]
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 44 def ==(other) end
The {#document} method returns the {Layout::Document} that the {Layout::Layer} belongs to.
@example
doc = Layout::Document.open("C:/path/to/document.layout") first_layer = doc.layers.first # layer_doc should reference the same document as doc layer_doc = first_layer.document
@return [Layout::Document]
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 59 def document end
The {#layer_instance} method returns a {Layout::LayerInstance} from the {Layout::Layer}. If the {Layout::Layer} is shared, a {Layout::Page} does not have to be provided.
@example
doc = Layout::Document.open("C:/path/to/document.layout") layers = doc.layers page = doc.pages.first layer_instance = layers.first.layer_instance(page)
@overload layer_instance
@return [Layout::LayerInstance]
@overload layer_instance
(page)
@param [Layout::Page] page @return [Layout::LayerInstance]
@raise [ArgumentError] if the {Layout::Layer} is not shared and no page is
provided
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 85 def layer_instance(page) end
The {#locked=} method sets whether the {Layout::Layer} is locked.
@example
doc = Layout::Document.open("C:/path/to/document.layout") layers = doc.layers layers.first.locked = false
@param [Boolean] locked
+true+ to lock the {Layout::Layer}, +false+ to unlock it
@raise [ArgumentError] if the {Layout::Layer} could not be locked because
there must be at least one unlocked, visible {Layout::Layer}
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 103 def locked=(locked) end
The {#locked?} method returns whether the {Layout::Layer} is locked.
@example
doc = Layout::Document.open("C:/path/to/document.layout") layers = doc.layers is_locked = layer.first.locked?
@return [Boolean]
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 116 def locked? end
The {#name} method returns the name of the {Layout::Layer}.
@example
doc = Layout::Document.open("C:/path/to/document.layout") layers = doc.layers layer_name = layers.first.name
@return [String]
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 129 def name end
The {#name=} sets the name of the {Layout::Layer}.
@example
doc = Layout::Document.open("C:/path/to/document.layout") layers = doc.layers layers.first.name = "Base layer"
@param [String] name
@raise [ArgumentError] if name is an empty string
@version LayOut 2018
# File lib/sketchup-api-stubs/stubs/Layout/Layer.rb, line 144 def name=(name) end