Class: Sketchup::Styles
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
| Class Chain: 
          self,
           Entity | |
| Instance Chain: 
          self,
          Enumerable,
           Entity | |
| Inherits: | Sketchup::Entity 
 | 
Overview
The Styles class contains methods for manipulating a collection of styles in a model. Typically, you will access this via the active_model:
Instance Attribute Summary
- 
    
      #selected_style  ⇒ Sketchup::Style 
    
    rw
    The #selected_style method is used to retrieve the style currently selected in the StylesBrowser.
- 
    
      #selected_style=(style)  ⇒ false 
    
    rw
    The #selected_style= method is used to set the currently selected style. 
Entity - Inherited
Instance Method Summary
- 
    
      #[](name)  ⇒ Sketchup::Style? 
    
    The #[] method is used to retrieves a style by either name or index. 
- 
    
      #active_style  ⇒ Sketchup::Style 
    
    The #active_style method is used to retrieve the active style. 
- 
    
      #active_style_changed  ⇒ Boolean 
    
    The #active_style_changed method tells you if the active style has been edited by the user since it was last saved. 
- 
    
      #add_style(filename, select)  ⇒ Boolean 
    
    The #add_style method is used to create and load a style from the given file. 
- #count ⇒ Integer
- 
    
      #each {|style| ... } ⇒ nil 
    
    The #each method is used to iterate through styles. 
- #length ⇒ Integer
- 
    
      #parent  ⇒ Sketchup::Model 
    
    The #parent method is used to return the model for the styles. 
- 
    
      #purge_unused  ⇒ true 
    
    The #purge_unused method is used to remove unused styles from the model. 
- 
    
      #size  ⇒ Integer 
    
    The #size method is used to retrieve the number of styles in the collection. 
- 
    
      #update_selected_style  ⇒ true 
    
    The #update_selected_style method commits the current style settings to the style selected in the StyleBrowser.
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
#selected_style ⇒ Sketchup::Style (rw)
The #selected_style method is used to retrieve the style currently selected in the Styles Browser.
    #selected_style=(style)  ⇒ false  (rw)
  
The #selected_style= method is used to set the currently selected style.
Instance Method Details
    
      #[](name)  ⇒ Sketchup::Style? 
      #[](index)  ⇒ Sketchup::Style? 
    
  
The #[] method is used to retrieves a style by either name or index.
#active_style ⇒ Sketchup::Style
The #active_style method is used to retrieve the active style.
While #selected_style is the style being selected in the Style Browser, the #active_style is a different object also including any unsaved style changes. These changes are silently dropped once a new style is selected. To save these changes to the selected style, call ##update_selected_style.
    #active_style_changed  ⇒ Boolean 
  
The #active_style_changed method tells you if the active style has been edited by the user since it was last saved.
    #add_style(filename, select)  ⇒ Boolean 
  
The #add_style method is used to create and load a style from the given file.
    #count  ⇒ Integer 
  
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.
    #each {|style| ... } ⇒ nil 
  
The #each method is used to iterate through styles.
    #length  ⇒ Integer 
  
The #length method is an alias of #size.
#parent ⇒ Sketchup::Model
The #parent method is used to return the model for the styles.
    #purge_unused  ⇒ true 
  
The #purge_unused method is used to remove unused styles from the model.
    #size  ⇒ Integer 
  
The #size method is used to retrieve the number of styles in the collection.
    #update_selected_style  ⇒ true 
  
The #update_selected_style method commits the current style settings to the style selected in the Style Browser.