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...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement