Class: SketchupExtension
| Relationships | |
| Inherits: | Object |
Overview
By default Extension Warehouse encrypts extensions and convert .rb files to .rbe files. Omit the file extension to let SketchUp look for both.
A SketchUp extension is a piece of software that extends the capabilities of SketchUp. It could be a new drawing tool, a content library or a way to automate a tedious and time consuming task.
The SketchupExtension handles the extension metadata, such as name,
author and version, as well as a path to the main Ruby file with the
actual functionality you want to add.
Class Method Summary
-
.new(title, path) ⇒ SketchupExtension
constructor
The new method is used to create a new
SketchupExtensionobject.
Instance Attribute Summary
-
#copyright ⇒ String
rw
The #copyright method returns the copyright string which appears beneath an extension inside the Extensions Manager dialog.
-
#copyright=(copyright) ⇒ String
rw
The #copyright= method sets the copyright string which appears beneath an extension inside the Extensions Manager dialog.
-
#creator ⇒ String
rw
The #creator method returns the creator string which appears beneath an extension inside the Extensions Manager dialog.
-
#creator=(creator) ⇒ String
rw
The #creator= method sets the creator string which appears beneath an extension inside the Extensions Manager dialog.
-
#description ⇒ String
rw
The #description method returns the long description which appears beneath an extension inside the Extensions Manager dialog.
-
#description=(description) ⇒ String
rw
The #description= method sets the long description which appears beneath an extension inside the Extensions Manager dialog.
-
#load_on_start? ⇒ Boolean
readonly
Returns whether the extension is set to load when SketchUp starts up.
-
#loaded? ⇒ Boolean
readonly
Returns whether the extension is currently loaded, meaning the actual ruby script that implements the extension has been evaluated.
-
#name ⇒ String
rw
The #name method returns the name which appears for an extension inside the Extensions Manager dialog.
-
#name=(name) ⇒ String
rw
The #name= method sets the name which appears for an extension inside the Extensions Manager dialog.
-
#registered? ⇒ Boolean
readonly
Returns whether the extension has been registered via
::Sketchup.register_extension. -
#version ⇒ String
rw
The #version method returns the version which appears beneath an extension inside the Extensions Manager dialog.
-
#version=(version) ⇒ String
rw
The #version= method sets the version which appears beneath an extension inside the Extensions Manager dialog.
Instance Method Summary
-
#check ⇒ Boolean
Loads the extension, meaning the underlying ruby script is immediately interpreted.
-
#extension_path ⇒ String
The #extension_path method returns the file system path to the extension's outer rb file.
-
#id ⇒ String
The #id method returns the Extension Warehouse ID string.
-
#load_error ⇒ Exception?
Return the Ruby load error for an extension that failed to load.
-
#uncheck ⇒ Boolean
Unloads the extension.
-
#version_id ⇒ String
The #version_id method returns the Extension Warehouse Version ID string.
Constructor Details
.new(title, path) ⇒ SketchupExtension
It is recommended to omit the file extension provided in the path
argument. SketchUp will resolve the file extension to .rbe, .rbs
or .rb.
The new method is used to create a new SketchupExtension object. Note
that once the extension object is created, it will not appear in the
Extension Manager dialog until your register it with the
::Sketchup.register_extension method.
Instance Attribute Details
#copyright ⇒ String (rw)
The #copyright method returns the copyright string which appears beneath
an extension inside the Extensions Manager dialog.
#copyright=(copyright) ⇒ String (rw)
The #copyright= method sets the copyright string which appears beneath
an extension inside the Extensions Manager dialog.
#creator ⇒ String (rw)
The #creator method returns the creator string which appears beneath
an extension inside the Extensions Manager dialog.
#creator=(creator) ⇒ String (rw)
The #creator= method sets the creator string which appears beneath
an extension inside the Extensions Manager dialog.
#description ⇒ String (rw)
The #description method returns the long description which appears beneath
an extension inside the Extensions Manager dialog.
#description=(description) ⇒ String (rw)
The #description= method sets the long description which appears beneath
an extension inside the Extensions Manager dialog.
#load_on_start? ⇒ Boolean (readonly)
Returns whether the extension is set to load when SketchUp starts up.
#loaded? ⇒ Boolean (readonly)
Returns whether the extension is currently loaded, meaning the actual ruby script that implements the extension has been evaluated.
#name ⇒ String (rw)
The #name method returns the name which appears for
an extension inside the Extensions Manager dialog.
#name=(name) ⇒ String (rw)
The #name= method sets the name which appears for
an extension inside the Extensions Manager dialog.
#registered? ⇒ Boolean (readonly)
Returns whether the extension has been registered via
::Sketchup.register_extension.
#version ⇒ String (rw)
The #version method returns the version which appears beneath
an extension inside the Extensions Manager dialog.
#version=(version) ⇒ String (rw)
The #version= method sets the version which appears beneath
an extension inside the Extensions Manager dialog.
Instance Method Details
#check ⇒ Boolean
Loads the extension, meaning the underlying ruby script is immediately interpreted. This is the equivalent of checking the extension's checkbox in the Extension Manager.
#extension_path ⇒ String
The #extension_path method returns the file system path to the extension's
outer rb file.
#id ⇒ String
The #id method returns the Extension Warehouse ID string.
#load_error ⇒ Exception?
Return the Ruby load error for an extension that failed to load.
#uncheck ⇒ Boolean
Unloads the extension. This is the equivalent of unchecking the extension's checkbox in the Extension Manager > Extensions list.
Note that technically the extension is not "unloaded" in the sense that it stops running during the current SketchUp session, but the next time the user restarts SketchUp, the extension will not be active.
#version_id ⇒ String
The #version_id method returns the Extension Warehouse Version ID string.