Class: Sketchup::Style

Inherits:
Entity
  • Object
show all

Overview

The Style class contains methods for modifying information about a specific style. Styles are a collection of display settings that tell SketchUp how to draw the model.

Examples:

# Get a handle to the styles collection.
styles = Sketchup.active_model.styles

# Display the name of the first style.
first_style = styles[0]
UI.messagebox("Your first style is named " + first_style.name.to_s)

Version:

  • SketchUp 6.0

Instance Method Summary collapse

Methods inherited from Entity

#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?

Instance Method Details

#descriptionObject

The description method is used to retrieve the description for a style.

Examples:

style = Sketchup.active_model.styles[0]
UI.messagebox("Your first style description is: " +
              style.description.to_s)

Returns:

  • description - the description for the style.

Version:

  • SketchUp 6.0

#description=(description) ⇒ Object

The description= method is used to set a description for a style.

Examples:

style = Sketchup.active_model.styles[0]
style.description = "My new style description."
UI.messagebox('My new style description is: ' + style.description)

Returns status - true if successful, false if unsuccessful.

Parameters:

  • description

    A textual description of the style.

Returns:

  • status - true if successful, false if unsuccessful.

Version:

  • SketchUp 6.0

#nameObject

The name method is used to retrieve the name for a style.

Examples:

name = style.name

Returns:

  • name - the name for the style.

Version:

  • SketchUp 6.0

#name=(name) ⇒ Object

The name= method is used to set the name for a style.

Examples:

style = Sketchup.active_model.styles[0]
style.name = 'My Very Own Style'
UI.messagebox('My new style name is: ' + style.name)

Returns name - the name that was set.

Parameters:

  • name
    • the new name for the style.

Returns:

  • name - the name that was set.

Version:

  • SketchUp 6.0