123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::OptionsManager

Relationships
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Enumerable
Inherits: Object

Overview

The OptionsManager class manages various kinds of OptionsProviders on a Model.

Version:

  • SketchUp 6.0

Instance Method Summary

Instance Method Details

#[](index) ⇒ Object #[](name) ⇒ Object

The [] method is used to get an option provider by name or index.

For example, to get the UnitsOptions on the Model, you could use the command:

Examples:

Sketchup.active_model.options["UnitsOptions"]
model = Sketchup.active_model
manager = model.options
provider = manager[0]
if (provider)
  UI.messagebox provider.name
else
  UI.messagebox "Failure"
end

Overloads:

  • #[](index) ⇒ Object

    Parameters:

    Returns:

  • #[](name) ⇒ Object

    Parameters:

    Returns:

Version:

  • SketchUp 6.0

#countObject

Note:

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.

Examples:

optionsmanager = Sketchup.active_model.options
number = manager.count

Returns:

See Also:

Version:

  • SketchUp 6.0

#each {|provider| ... } ⇒ nil

The #each method is used to iterate through options providers.

Examples:

model = Sketchup.active_model
manager = model.options
manager.each { |provider| puts provider.name }

Yield Parameters:

Version:

  • SketchUp 6.0

#keysObject

The keys method is used to get a list of keys in the OptionsManager.

Examples:

model = Sketchup.active_model
manager = model.options
optionproviderarray = manager.keys
if (optionproviderarray)
  UI.messagebox optionproviderarray
else
  UI.messagebox "Failure"
end

Returns:

Version:

  • SketchUp 6.0

#lengthInteger

The #length method is an alias of #size.

Examples:

optionsmanager = Sketchup.active_model.options
number = manager.length

See Also:

Version:

  • SketchUp 2014

#sizeInteger

The #size method returns the number of OptionsProvider objects inside this OptionsManager.

Examples:

optionsmanager = Sketchup.active_model.options
number = manager.size

See Also:

Version:

  • SketchUp 6.0