Simple example not working...
-
I wrote a quick test class just to check something, but I can't figure out why it isn't working:
require 'sketchup.rb' class Test < Sketchup;;AppObserver def onNewModel(model) UI.messagebox("new model!") end end t = Test.new Sketchup.add_observer(t)
That gives an error when SketchUp loads:
Error Loading File test.rb
Test is not a classAnyone?
-
"Test" is about the worst name you choose for an identifier. Try something more unique.
Otherwise, it looks like it should work.
-
-
No problem. I only knew because I did it myself at least one time.
Advertisement