Extension creation code
-
I have the following problem with the extension installation in Sketchup 2016:
I use the following code to load my plugin:
` # Load the normal support files.
require 'sketchup.rb'
require 'extensions.rb'Create the extension.
ext = SketchupExtension.new('pluginName', File.join('pluginFolder', 'pluginLoader.rb'))
Attach some nice info.
ext.creator = 'xxxxx'
ext.version = '1.0.0'
ext.copyright = '2016, xxxxxxxx'
ext.description = 'xxxxxxxxxxxxxxxxxxx'ext.extension_path=File.join(File.dirname(FILE), "pluginFolder" )
Register and load the extension on startup.
Sketchup.register_extension(ext, true)`
The Preferences/Extension Window then shows 2 entries for my plugin, one with the name of the pluginFolder and one with the pluginName. Only the entry with the pluginName shows also the plugin details.
When I delete the ext.extension_path entry in the above code, everything seems to be OK.
As I use the ext.extension_path in my loader file I need to fix this problem, which did not occur in previous Sketchup Versions.Help is very much appreciated
-
You have omitted some code and added in other unneeded code.
Try:
` # Load the normal support files.
require 'sketchup.rb'
require 'extensions.rb'Create the extension.
ext = SketchupExtension.new('pluginName', File.join('pluginFolder', 'pluginLoader.rb'))
# Optionally 'name' the Extension - it can differ from the registered name.
ext.name = 'pluginName'Attach some nice info.
ext.creator = 'xxxxx'
ext.version = '1.0.0'
ext.copyright = '2016, xxxxxxxx'
ext.description = 'xxxxxxxxxxxxxxxxxxx'# This 'path' is NOT needed.
ext.extension_path=File.join(File.dirname(FILE), "pluginFolder" )Register and load the extension on startup.
Sketchup.register_extension(ext, true)`
Add in the bold code and remove the
struck-throughcode...
Advertisement