Are you properly packaging a SketchupExtension object ?
Ie, a proper extension registrar script and a extension subfolder of the same name with the code files in the folder ?
Sometimes this is easier because it clears out memory. But you can use the console to reload specific code files using the global load() method. (This method requires the full path and a file type as the argument.)
You can also create menu items that do the reload and later remove them when you publish the extension.
Ie, something like this in your extension code within your extension’s subfolder.
# Within your extension subfolder ONLY.
# Do not put this code in a file in the "Plugins" folder !
module TKS
module SomePlugin
if !defined?(@gui_loaded)
# This assumes you have created a SketchupExtension object in a registrar
# file in the "Plugins" folder, referenced by a local constant EXTENSION.
UI.menu("Developer").add_item("Reload Code Files: #{EXTENSION.name}") {
prev_dir = Dir.pwd
Dir.chdir(__dir__) do
Dir.glob("*.rb").each { |rb_file| load(rb_file) }
rescue => error
puts error.inspect
puts error.backtrace
Dir.chdir(prev_dir)
end
}
@gui_loaded = true
end
end
end
This can be very technically complicated and there are other topics about this:
… Do a category search for more results …
Search results for ‘#developers:ruby-api debugging’ - SketchUp Community