©2009 Google -
Code Home -
Terms of Service -
Privacy Policy -
Site Directory
Google Code offered in:
English -
Español -
日本語 -
한국어 -
Português -
Pусский -
中文(简体) -
中文(繁體)
This observer interface is implemented to react to entity events. To implement this observer, create a Ruby class of this type, override the desired methods, and add an instance of the observer to the entity of interests.
# This is an example of an observer that watches an entity for deletion
# and shows a messagebox.
class MyEntityObserver < Sketchup::EntityObserver
def onEraseEntity(entity)
UI.messagebox("onEraseEntity: " + entity.to_s)
end
end
# Attach the observer. (Assumes there is an entity in the model.)
Sketchup.active_model.entities[0].add_observer(MyEntityObserver.new)The onEraseEntity method is invoked when your entity is modified.
Arguments:
Returns:
def onChangeEntity(entity)
UI.messagebox("onChangeEntity: " + entity.to_s)The onEraseEntity method is invoked when your entity is erased.
Arguments:
Returns:
def onEraseEntity(entity)
UI.messagebox("onEraseEntity: " + entity.to_s)