Class: Sketchup::Styles
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 Method Summary # collapse
-
#[](arg) ⇒ Object
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.
-
#selected_style ⇒ Sketchup::Style
The #selected_style method is used to retrieve the style currently selected in the Styles Browser.
-
#selected_style=(style) ⇒ false
The #selected_style= method is used to set the currently selected style.
-
#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.
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
↑ #[](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
↑ #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.
↑ #selected_style ⇒ Sketchup::Style
The #selected_style method is used to retrieve the style currently selected in the Styles Browser.
↑ #selected_style=(style) ⇒ false
The #selected_style= method is used to set the currently selected style.
↑ #update_selected_style ⇒ true
The #update_selected_style method commits the current style settings to the style selected in the Style Browser.