Class: Sketchup::LayerFolder
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 Method Summary # collapse
-
#<=>(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(arg) ⇒ 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.
-
#each_folder {|folder| ... } ⇒ Object
The #each_folder method is used to iterate through the folders that are direct children to the folder.
-
#each_layer {|layer| ... } ⇒ Object
(also: #each)
The #each_layer method is used to iterate through the layers that are direct children to the folder.
-
#folder ⇒ Sketchup::LayerFolder?
The #folder method is used to return the parent layer folder of a layer folder.
-
#folder=(parent) ⇒ Object
The #folder= method is used to set the parent layer folder of a layer 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.
-
#name ⇒ String
(also: #display_name)
The #name method gets the name of the folder.
-
#name=(name) ⇒ Object
The #name= method sets the name of the folder.
-
#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.
-
#visible=(visible) ⇒ Object
The #visible= method is used to set if the layer folder is visible.
-
#visible? ⇒ Boolean
The #visible? method is used to determine if the layer folder is visible.
-
#visible_on_new_pages=(visible) ⇒ Object
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
The #visible_on_new_pages? method is used to determine if the layer folder is by default visible on new pages.
Methods inherited from Entity
#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?
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.
↑ #add_folder(name) ⇒ Sketchup::LayerFolder #add_folder(folder) ⇒ 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 known as: length, size
The #count_layers method retrieves the number of layers in the folder.
↑ #each_folder {|folder| ... } ⇒ Object
The #each_folder method is used to iterate through the folders that are direct children to the folder.
↑ #each_layer {|layer| ... } ⇒ Object Also known as: each
The #each_layer method is used to iterate through the layers that are direct children to the folder.
↑ #folder ⇒ Sketchup::LayerFolder?
The #folder method is used to return the parent layer folder of a layer folder.
↑ #folder=(parent) ⇒ Object
The #folder= method is used to set the parent layer folder of a layer folder.
This will trigger onLayerFolderRemoved
followed by onLayerFolderAdded
.
↑ #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.
↑ #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.
↑ #visible_on_new_pages=(visible) ⇒ Object
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
The #visible_on_new_pages? method is used to determine if the layer folder is by default visible on new pages.