Class: Sketchup::InstanceObserver
- Inherits:
-
EntityObserver
- Object
- EntityObserver
- Sketchup::InstanceObserver
Overview
This observer interface is implemented to react to component instance 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.
Note that you may also attach InstanceObservers to Groups.
Instance Method Summary # collapse
-
#onClose(instance) ⇒ nil
The #onClose method is called when an instance is 鈥渃losed,鈥 meaning an end user was editing a component's geometry and then exited back into the parent's editing space.
-
#onOpen(instance) ⇒ nil
The #onOpen method is called when an instance is 鈥渙pened,鈥 meaning an end user has double clicked on it to edit its geometry.
Methods inherited from EntityObserver
#onChangeEntity, #onEraseEntity
Instance Method Details
↑ #onClose(instance) ⇒ nil
The #onClose method is called when an instance is 鈥渃losed,鈥 meaning an end user was editing a component's geometry and then exited back into the parent's editing space.
↑ #onOpen(instance) ⇒ nil
The #onOpen method is called when an instance is 鈥渙pened,鈥 meaning an end user has double clicked on it to edit its geometry. This is particularly useful if your plugin is dynamically drawing geometry or performing transformations in global space, since when in 鈥渆dit component鈥 mode all transformations and positions are returned in relation to the current component's origin.
This method will tell you when a user has entered edit mode, and you can then use Model#active_path and Model#edit_transform methods to determine any corrections you need to make to your transformations.