class SketchupExtension

Parent: Object | Class Index
Methods: new, copyright, copyright= creator, creator=, description, description=, name, name=, version, version= |
Sample Code: utilities.rb |

The SketchupExtension 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.

Class Methods

new
The new method is used to create a new SketchupExtension class.
Syntax:
sketchupextension = SketchupExtension.new "Title" "path"
Arguments:
"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.
Return Value:
sketchupextennsion - the new SketchupExtension object
Comments:
Example:
extension = SketchupExtension.new "Stair Tools" "utilities/stairTools.rb"

Instance Methods

creator
The creator method is used to get the value for the creator of an extension.
Syntax:
creator = sketchupextension.creator
Arguments:
Return Value:
creator - a string representing the creator of the extension.
Comments:
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.
Example:
creator = se.creator

creator=
The creator= method is used to setthe value for the creator of an extension.
Syntax:
creator = sketchupextension.creator= "CreatorName"
Arguments:
"CreatorName" - a string representing the name of the extension's creator
Return Value:
creator - a string representing the creator of the extension.
Comments:
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.
Example:
utilitiesExtension.creator=$uStrings.GetString("Fred Smith")

copyright
The copyright method is used to get the value for the copyright of an extension.
Syntax:
copyright = sketchupextension.copyright
Arguments:
Return Value:
copyright - a string representing the copyright of the extension.
Comments:
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.
Example:
copyright = se.copyright

copyright=
The copyright= method is used to set the value for the copyright of an extension.
Syntax:
copyright = sketchupextension.copyright = "Copyright"
Arguments:
Copyright - a string representing the copyright of the extension.
Return Value:
copyright - a string representing the copyright of the extension.
Comments:
Example:
utilitiesExtension.copyright=$uStrings.GetString("2004-2005 Joe Software")

description
The description method is used to get the value for the description of an extension.
Syntax:
description = sketchupextension.description
Arguments:
Return Value:
description - a string representing the description of the extension.
Comments:
Example:
description = se.description

description=
The description= method is used to set the value for the description of an extension.
Syntax:
description = sketchupextension.description = "Description"
Arguments:
Description - a string representing the description of the extension.
Return Value:
description - a string representing the description of the extension.
Comments:
Example:
utilitiesExtension.description=$uStrings.GetString("Adds Tools->Utilities to the SketchUp inteface. The Utilities submenu contains two tools: Create Face and Query Tool.")

name
The name method is used to get the value for the name of an extension.
Syntax:
name= sketchupextension.name
Arguments:
Return Value:
name - a string representing the name of the extension.
Comments:
Example:
name = se.name

name=
The name= method is used to set the value for the name of an extension.
Syntax:
name= sketchupextension.name= "Name"
Arguments:
Name - a string representing the name of the extension.
Return Value:
name - a string representing the name of the extension.
Comments:
Example:
utilitiesExtension.name=$uStrings.GetString("Stair Tool")

version
The version method is used to get the value for the name of an version.
Syntax:
version= sketchupextension.version
Arguments:
Return Value:
version - a string representing the name of the version
Comments:
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.
Example:
version = se.version

version=
The version= method is used to set the value for the version of an extension.
Syntax:
version = sketchupextension.version= "Version"
Arguments:
Version - a string representing the version of the extension.
Return Value:
version - a string representing the version of the extension.
Comments:
Example:
utilitiesExtension.version=$uStrings.GetString("1.0")