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/
Advertisement