For creating extensions, please be sure to read and understand …
… and …
-
SketchUp Help Center: Extension Development Best Practices
Be sure to read the Technical Requirements section.
It is required that the extension registrar script and the extension subfolder have the names of your top level namespace, and underscore, and then the module name of the extension.
Example …
"BarcelonaGeordie_HelloWorld.rb"
… and the subfolder with the extension’s code files be …
"BarcelonaGeordie_HelloWorld"
All of your various extensions must be inside a unique namespace module.
Each of your extensions should be separated from one another within a submodule of their own.
Example registrar script that goes in the “Plugins” folder:
# encoding: UTF-8
# File: "BarcelonaGeordie_HelloWorld.rb"
# A SketchupExtension registrar file for: "Hello World"
#
module BarcelonaGeordie
module HelloWorld
EXTENSION = SketchupExtension.new(
'Hello World', 'BarcelonaGeordie_HelloWorld/HelloWorld.rb'
)
EXTENSION.instance_eval {
self.description= 'An example extension that says "Hello".'
self.version= '1.0.0'
self.copyright= "© #{Time.now.year}, "<<Module.nesting[1].name
self.creator= 'Barcelona Geordie'
Sketchup.register_extension(self, true)
}
end # extension submodule
end # top level namespace module