Well, it’s interesting! I’m an amateur too.
Yes, uploading the file is better than zipping it. I take it that you’re trying to zip the file so it can be installed… but you’re getting ahead of yourself. Also, if you post the code correctly, people can see it without having to download anything, which might lead more people to actually look at it.
But if you wanted to upload a folder - zipped or not- You don’t have a registrar / registration file with it. Also, you didn’t use a namespace and module name. You need both.
The registration file could be something like this:
Registration File
require 'sketchup.rb'
require 'extensions.rb'
module JHJ
module PushTool
PLUGIN_PATH = File.dirname(__FILE__)
unless file_loaded?(__FILE__)
loader = File.join(PLUGIN_PATH, 'jhj_push', 'main.rb')
extension = SketchupExtension.new('JHJ Push Tool', loader)
extension.description = 'An example extension for pushing faces to a maximum distance.'
extension.version = '1.0.0'
extension.creator = 'JHJ'
Sketchup.register_extension(extension, true)
file_loaded(__FILE__)
end
end
end
I don’t understand what you mean in the vid. If a user needs to move the face in or out, that implies they don’t know which way they intend to move the face before they begin moving it. Also, selecting the face, then moving it, then [do something], then the face connects to the other face (that you can’t see because you don’t want to rotate) is more steps.
So, the extension being launched from a keyboard shortcut or toolbar button and immediately doing what’s intended seems better. It could have no prompt or dialog, but then you wouldn’t be able to affect the max distance. This would be good if you only want to connect faces but never extrude to a specified distance.
Here’s an example that lets the user immediately pull but also have an option to push. It doesn’t pull if the raytest hits and push if the raytest misses, like before. Instead, it pulls or pushes until it hits a face or reaches the max distance. This means the behavior is more consistent/expected. I might change this example so that it doesn’t start with pull enabled… but that’s another issue.