|
SketchUp Ruby API Reference |
The Extension class contains methods allowing you to create and manipulate SketchUp extensions. Extensions are Ruby scripts that can be loaded and unloaded using the Extension manager (Extensions panel of the Preferences dialog box). Generally you should register your ruby scripts as an extension to give SketchUp users the ability to disable it through the user interface.
Parent: Object
Methods:new ,copyright, copyright=, creator, creator=, description, description=, load, name, name=, version, version=
Example Code:utilities.rb
The new method is used to create a new SketchupExtension class.
sketchupextension = SketchupExtension.new "Title" "path"
"Title" - the title for the new extension that will appear in the Extensions portion of the Preferences dialog box.
"path" - the relative path to the extension.
sketchupextennsion - the new SketchupExtension object
extension = SketchupExtension.new "Stair Tools" "utilities/stairTools.rb"
The copyright method is used to get the value for the copyright of an extension.
copyright = sketchupextension.copyright
copyright - a string representing the copyright of the extension.
The default copyright string is "2005, @Last Software." Change the copyright using the copyright= method if the copyright of the extension is other than 2005, @Last Software.
copyright = se.copyright
The copyright= method is used to set the value for the copyright of an extension.
copyright = sketchupextension.copyright = "Copyright"
Copyright - a string representing the copyright of the extension.
copyright - a string representing the copyright of the extension.
utilitiesExtension.copyright=$uStrings.GetString("2004-2005 Joe Software")
The creator method is used to get the value for the creator of an extension.
creator = sketchupextension.creator
creator - a string representing the creator of the extension.
The default creator string is "@Last Software." Change the creator using the creator= method if the creator of the extension is other than @Last Software.
creator = se.creator
The creator= method is used to set the value for the creator of an extension.
creator = sketchupextension.creator= "CreatorName"
"CreatorName" - a string representing the name of the extension's creator
creator - a string representing the creator of the extension.
The default creator string is "@Last Software." Change the creator using the creator= method if the creator of the extension is other than @Last Software.
utilitiesExtension.creator=$uStrings.GetString("Fred Smith")
The description method is used to get the value for the description of an extension.
description = sketchupextension.description
description - a string representing the description of the extension.
description = se.description
The description= method is used to set the value for the description of an extension.
description = sketchupextension.description = "Description"
Description - a string representing the description of the extension.
description - a string representing the description of the extension.
utilitiesExtension.description=$uStrings.GetString("Adds Tools->Utilities to the SketchUp inteface. The Utilities submenu contains two tools: Create Face and Query Tool.")
The load method is used to load an extension from the Ruby extension manager.
Extension.load
You will generally not call this method from a Ruby script. This method exists primarily to be called when an extension is turned on using the SketchUp extension manager.
The name method is used to get the value for the name of an extension.
name= sketchupextension.name
name - a string representing the name of the extension.
name = se.name
The name= method is used to set the value for the name of an extension.
name= sketchupextension.name= "Name"
Name - a string representing the name of the extension.
name - a string representing the name of the extension.
utilitiesExtension.name=$uStrings.GetString("Stair Tool")
The version method is used to get the value for the name of an version.
version= sketchupextension.version
version - a string representing the name of the version
The default version string is "1.0" Change the creator using the version= method if the version of the extension is other than 1.0.
version = se.version
The version= method is used to set the value for the version of an extension.
version = sketchupextension.version= "Version"
Version - a string representing the version of the extension.
version - a string representing the version of the extension.
utilitiesExtension.version=$uStrings.GetString("1.0")
|
SketchUp Ruby API Reference: Extension |
© Google Inc. 2007 sketchup.google.com |