123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::ExtensionsManager

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

Overview

The ExtensionsManager class provides a way of accessing the SketchupExtensions that have been registered via the ::Sketchup.register_extension method.

There is only one ExtensionsManager available. You access it via the ::Sketchup.extensions method.

Version:

  • SketchUp 8.0 M2

Instance Method Summary

Instance Method Details

#[](index_or_name) ⇒ SketchupExtension?

Note:

Index starts at 1.

The [] method is used to get an extension by name, index or ID.

Examples:

manager = Sketchup.extensions
extension = manager[1]
if (extension)
  puts extension.name
else
  puts "No Extensions installed"
end

# You can also get extensions by name.
solarnorth = manager['Solar North Toolbar']

# You can also get extensions by ID.
my_extension = manager['2475A758-6503-46D5-AC5E-16AEA0A3162A']

Parameters:

Version:

  • SketchUp 8.0 M2

#countInteger

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:

manager = Sketchup.extensions
number = manager.count

See Also:

Version:

  • SketchUp 8.0 M2

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

The #each method is used to iterate through extensions.

Examples:

manager = Sketchup.extensions
# Retrieves each extension
manager.each { |extension| puts extension.name }

Yield Parameters:

Version:

  • SketchUp 8.0 M2

#keysObject

The keys method is used to get a list of keys in the ExtensionsManager, which are the same as the names of the extensions.

Examples:

manager = Sketchup.extensions
keys = manager.keys
for key in keys
  UI.messagebox('The next extension is named: ' + key)
end

Returns:

Version:

  • SketchUp 8.0 M2

#lengthInteger

The #length method returns the number of ::SketchupExtension objects inside this ExtensionsManager.

Examples:

manager = Sketchup.extensions
number = manager.length

See Also:

Version:

  • SketchUp 8.0 M2

#sizeInteger

The #size method is an alias of #length.

Examples:

manager = Sketchup.extensions
number = manager.size

See Also:

Version:

  • SketchUp 8.0 M2