|
SketchUp Ruby API Reference |
The Styles class contains methods for manipulating a collection of styles in a model.
Parent:
Methods: [], active_style, active_style_changed, add_style, count, each, parent, purge_unused, selected_style, selected_style=, size, update_selected_style
Example Code:
The [] method is used to retrieves a style by either name or index.
style = styles[index]
style = styles["name"]
index - the index for a specific style
name - the name of the specific style
style - a Style object if successful
The active_style method is used to retrieve the active style.
style = styles.active_style
style - the active Style object.
The active_styles_changed method is used to...
styles.active_styles_changed
The add_style method is used to create and load a style from the given file.
status = styles.add_style filename select
filename - the filename for the style.
selective - true if you want to set the style to be the active style, false if you do not want to set the style to the active style.
status - true if successful, false if unsuccessful.
The count method is an alias for size. See Styles.size.
The each method is used to iterate through styles.
styles.each {| style |...}
style – variables that will hold each style as it is found.
The parent method is used to determine the model for the styles.
model = styles.parent
model - the model that contains the styles if successful
The purge_unused method is used to remove unused styles.
status = styles.purge_unused
status - true if successful, false if unsuccessful.
The selected_style method is used to retrieve the currently selected style.
style = styles.selected_style
style - the currently selected Style object.
The selected_style= method is used to set the currently selected style.
status = styles.selected_style = style
style - a Style object.
status - true if successful, false if unsuccessful.
The size method is used to retrieve the size (number of elements) in a styles object .
size = styles.size
size – the number of Styles if successful.
|
SketchUp Ruby API Reference: Styles class |
© Google Inc. 2006 sketchup.google.com |