Class: Sketchup::LayerFolder
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: 
          self,
           Entity | |
| Instance Chain: 
          self,
          Comparable,
           Entity | |
| Inherits: | Sketchup::Entity 
 | 
Overview
As of SketchUp 2020 “Layers” were renamed to “Tags” in the ::UI. The API retains the use of “Layer” for compatibility and is synonymous with “Tag”.
Allows layers to be organized in folders. Folders may have duplicate names.
Instance Attribute Summary
- 
    
      #folder  ⇒ Sketchup::LayerFolder? 
    
    rw
    The #folder method is used to return the parent layer folder of a layer folder. 
- 
    
      #folder=(parent)  
    
    rw
    The #folder= method is used to set the parent layer folder of a layer folder. 
- 
    
      #name  ⇒ String 
      (also: #display_name)
    
    rw
    The #name method gets the name of the folder. 
- 
    
      #name=(name)  
    
    rw
    The #name= method sets the name of the folder. 
- 
    
      #visible=(visible)  
    
    rw
    The #visible= method is used to set if the layer folder is visible. 
- 
    
      #visible?  ⇒ Boolean 
    
    rw
    The #visible? method is used to determine if the layer folder is visible. 
- 
    
      #visible_on_new_pages=(visible)  
    
    rw
    The #visible_on_new_pages= method is used to set if the layer folder is by default visible on new pages. 
- 
    
      #visible_on_new_pages?  ⇒ Boolean 
    
    rw
    The #visible_on_new_pages? method is used to determine if the layer folder is by default visible on new pages. 
Entity - Inherited
Instance Method Summary
- 
    
      #<=>(other)  ⇒ Integer? 
    
    The #<=> method is used to compare two layer folders based on their names. 
- 
    
      #==(other)  ⇒ Boolean 
    
    The #== method is used to determine if two layer folders are the same. 
- 
    
      #add_folder(name)  ⇒ Sketchup::LayerFolder 
    
    The #add_folder method adds or moves a layer folder. 
- 
    
      #add_layer(layer)  ⇒ nil 
    
    The #add_layer method adds a layer to a folder. 
- 
    
      #count_folders  ⇒ Integer 
    
    The #count_folders method retrieves the number of child folders in the folder. 
- 
    
      #count_layers  ⇒ Integer 
      (also: #length, #size)
    
    The #count_layers method retrieves the number of layers in the folder. 
- 
    
      #display_name  
    
    Alias for #name. 
- 
    
      #each  
    
    Alias for #each_layer. 
- 
    
      #each_folder {|folder| ... } 
    
    The #each_folder method is used to iterate through the folders that are direct children to the folder. 
- 
    
      #each_layer {|layer| ... } 
      (also: #each)
    
    The #each_layer method is used to iterate through the layers that are direct children to the folder. 
- 
    
      #folders  ⇒ Array<Sketchup::LayerFolder> 
    
    The #folders returns the direct child-folders of the folder. 
- 
    
      #layers  ⇒ Array<Sketchup::Layer> 
    
    The #layers method retrieves the child layers of a folder. 
- 
    
      #length  
    
    Alias for #count_layers. 
- 
    
      #remove_folder(folder)  ⇒ nil 
    
    The #remove_folder method removes the folder from the model. 
- 
    
      #remove_layer(layer)  ⇒ nil 
    
    The #remove_layer method removes a layer from a folder. 
- 
    
      #size  
    
    Alias for #count_layers. 
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 Attribute Details
    #folder  ⇒ LayerFolder?  (rw)
  
The #folder method is used to return the parent layer folder of a layer folder.
#folder=(parent) (rw)
The #folder= method is used to set the parent layer folder of a layer folder.
This will trigger onLayerFolderRemoved followed by onLayerFolderAdded.
#name ⇒ String (rw) Also known as: #display_name
The #name method gets the name of the folder.
#name=(name) (rw)
The #name= method sets the name of the folder.
#visible=(visible) (rw)
The #visible= method is used to set if the layer folder is visible.
    #visible?  ⇒ Boolean  (rw)
  
The #visible? method is used to determine if the layer folder is visible.
#visible_on_new_pages=(visible) (rw)
The #visible_on_new_pages= method is used to set if the layer folder is by default visible on new pages.
    #visible_on_new_pages?  ⇒ Boolean  (rw)
  
The #visible_on_new_pages? method is used to determine if the layer folder is by default visible on new pages.
Instance Method Details
    #<=>(other)  ⇒ Integer? 
  
The #<=> method is used to compare two layer folders based on their names. This enables the Ruby Array#sort method to sort SketchUp layer folders.
    #==(other)  ⇒ Boolean 
  
The #== method is used to determine if two layer folders are the same.
    
      #add_folder(name)  ⇒ LayerFolder 
      #add_folder(folder)  ⇒ LayerFolder 
    
  
LayerFolder 
      #add_folder(folder)  ⇒ LayerFolder 
    The #add_folder method adds or moves a layer folder.
    #add_layer(layer)  ⇒ nil 
  
The #add_layer method adds a layer to a folder.
    #count_folders  ⇒ Integer 
  
The #count_folders method retrieves the number of child folders in the folder.
    #count_layers  ⇒ Integer 
    Also known as: #length, #size
  
The #count_layers method retrieves the number of layers in the folder.
#display_name
Alias for #name.
#each
Alias for #each_layer.
#each_folder {|folder| ... }
The #each_folder method is used to iterate through the folders that are direct children to the folder.
#each_layer {|layer| ... } Also known as: #each
The #each_layer method is used to iterate through the layers that are direct children to the folder.
    #folders  ⇒ Array<LayerFolder> 
  
The #folders returns the direct child-folders of the folder.
#layers ⇒ Array<Sketchup::Layer>
The #layers method retrieves the child layers of a folder.
#length
Alias for #count_layers.
    #remove_folder(folder)  ⇒ nil 
  
The #remove_folder method removes the folder from the model. All children are preserved, but move up one level.
    #remove_layer(layer)  ⇒ nil 
  
The #remove_layer method removes a layer from a folder. The layer will be parent to the layer manager.
#size
Alias for #count_layers.