Observer problem onDeleteModel ?
-
**I tried this, according with Ruby Api:
class MyModelObserver < Sketchup;;ModelObserver def onDeleteModel(model) UI.messagebox("onDeleteModel; " + model.to_s) end end Sketchup.active_model.add_observer(MyModelObserver.new)but I had the unpleasant surprise to see that nothing happens when deleting something.
Should I use entity observer? I will give it a try, but I suspect that is my answer. Anyway, this post stays because I want to understand what "model" means.
When this observer reacts?** -
@unknownuser said:
When this observer reacts?
I would guess the onDeleteModel method only fires on a Mac which can have multiple models open simultaneously.
An EntitiesObserver might be appropriate:
http://code.google.com/apis/sketchup/docs/ourdoc/entitiesobserver.html -
@jim said:
I would guess the onDeleteModel method only fires on a Mac which can have multiple models open simultaneously.
I tend to agree that your guess is right !
If it's confirmed, maybe it would be appropriate that this mention to be added in SU Ruby Api (Google guys do this? ) -
I can try this on my Mac. It's one of the event's I've not managed to work out. http://www.thomthom.net/software/sketchup/observers/
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