|
SketchUp Ruby API Reference |
This observer interface is implemented to react to component definition 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 objects of interests.
class MyEntityObserver < Sketchup::EntityObserver def onEntityChanged (entity) # do something end end
# In your code. If the face changes, MyEntityObserver is called. face.add_observer(MyEntityObserver.new)
Parent: <parent in class hierarchy>
Methods: onComponentInstanceAdded, onComponentInstanceRemoved
Example code:
The onComponentInstanceAdded method is called when a new component instance is added to a model.
definition - a Component definition object.
instance - a Component instance object.
The onComponentInstanceRemoved method is called when a component instance is removed from a model.
definition - a Component definition object.
instance - a Component instance object.
|
SketchUp Ruby API Reference: DefinitionObserver interface |
© Google Inc. 2007 sketchup.google.com |