(You do not need to call .draw method, it is called by SketchUp whenever the view is refreshed to allow the tool/overlay to do its own drawing. You can force to call by e.g. view.invalidate )
Reread the Overlay class introduction. It shows how to add an overlay to a model.
But it also lacks the statement to enable it. Overlays will be disabled by default.
# Using an observer to create a new overlay per model.
class ExampleAppObserver < Sketchup::AppObserver
def expectsStartupModelNotifications
true
end
def register_overlay(model)
overlay = ExampleOverlay.new
model.overlays.add(overlay)
overlay.enabled= true
end
alias_method :onNewModel, :register_overlay
alias_method :onOpenModel, :register_overlay
end
observer = ExampleAppObserver.new
Sketchup.add_observer(observer)
It’s worth noting that the Overlay#enabled= method is exactly equivalent to the checkbox in the SketchUp Overlays panel (checked => enabled = true, unchecked => enabled = false). One might want to leave the overlay disabled until the user clicks that box so that it doesn’t immediately start drawing onto every model, which could be annoying.