I’m new to creating extensions…how should I start my new extension. Here’s what I have. How does this look?
#protrim.rb
require 'sketchup.rb'
require 'extenions.rb'
module Examples
module CustomTool
#Loading Extension
unless file_loaded?()
ex=SketchupExtension.new('ProTrim')
ex.description='Trim builder using the FollowMe function.'
ex.version='1.0.0'
ex.copyright='Softworx 2019'
ex.creator='Softworx'
Sketchup.register_extension(ex, true)
file_loaded()
end
class ComponentInstance
#Activating extension for use
def activate
@mouse_ip=Sketchup::InputPoint.new
@picked_first_ip=Sketchup::InputPoint.new
update_ui
end
def deactivate(view)
view.invalidate
end
#Suspend use of extension
def resume(view)
update_ui
view.invalidate
end
#Resetting if interrupted
def onCancel(reason, view)
reset_tool
view.invalidate
end
model=Sketchup.active_model
entities=Sketchup.active_model.entities
UI.menu("Extensions").add_item("ProTrim") {
UI.messagebox("Welcome to ProTrim. Select your trim, select the path you wish it to extrude on, and click ok.")
#Method
draw_trim_profile
}
def draw_trim_profile
#Create variables
puts"Trim Height"
trim_height=gets.chomp
puts"Trim Width"
trim_width=gets.chomp
puts"Quarter Round"
quarter_rount_width=gets.chomp
quarter_round_height= quarter_rount_width
end