Class: Sketchup::InstanceObserver Abstract
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
EntityObserver
|
|
|
Instance Chain:
self,
EntityObserver
|
|
| Inherits: |
Sketchup::EntityObserver
|
Overview
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.
This observer interface is implemented to react to component instance events.
Note that you may also attach InstanceObservers to
Groups.
Instance Method Summary
-
#onClose(instance) ⇒ nil
The #onClose method is called when an instance is "closed," 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 "opened," meaning an end user has double clicked on it to edit its geometry.
EntityObserver - Inherited
| #onChangeEntity | The |
| #onEraseEntity | The |
Instance Method Details
#onClose(instance) ⇒ nil
The #onClose method is called when an instance is "closed," 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 "opened," 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 "edit 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.