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.

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement