Class: Sketchup::Styles
- Includes:
- Enumerable
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb
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.
38 39 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 38 def [](arg) end |
#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.
55 56 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 55 def active_style end |
#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.
68 69 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 68 def active_style_changed end |
#add_style(filename, select) ⇒ Boolean
The #add_style method is used to create and load a style from the given file.
88 89 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 88 def add_style(filename, select) end |
#count ⇒ Integer
103 104 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 103 def count end |
#each {|style| ... } ⇒ nil
The #each method is used to iterate through styles.
119 120 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 119 def each end |
#length ⇒ Integer
133 134 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 133 def length end |
#parent ⇒ Sketchup::Model
The #parent method is used to return the model for the styles.
145 146 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 145 def parent end |
#purge_unused ⇒ true
The #purge_unused method is used to remove unused styles from the model.
157 158 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 157 def purge_unused end |
#selected_style ⇒ Sketchup::Style
The #selected_style method is used to retrieve the style currently selected in the Styles Browser.
170 171 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 170 def selected_style end |
#selected_style=(style) ⇒ false
The #selected_style= method is used to set the currently selected style.
184 185 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 184 def selected_style=(style) end |
#size ⇒ Integer
The #size method is used to retrieve the number of styles in the collection.
199 200 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 199 def size end |
#update_selected_style ⇒ true
The #update_selected_style method commits the current style settings to the style selected in the Style Browser.
214 215 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb', line 214 def update_selected_style end |