Class: Sketchup::SelectionObserver
- Inherits:
-
Object
- Object
- Sketchup::SelectionObserver
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb
Overview
This observer interface is implemented to react to selection 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.
Instance Method Summary collapse
- #onSelectionAdded(selection, entity) ⇒ nil
-
#onSelectionBulkChange(selection) ⇒ nil
The #onSelectionBulkChange method is called whenever items are added or removed from the selection set.
-
#onSelectionCleared(selection) ⇒ nil
The #onSelectionCleared method is called when the selection is completely emptied.
- #onSelectionRemoved(selection, entity) ⇒ nil
Instance Method Details
#onSelectionAdded(selection, entity) ⇒ nil
This event might not trigger even if a single element is selected. For instance the Selection tool will trigger #onSelectionBulkChange regardless.
44 45 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb', line 44 def onSelectionAdded(selection, entity) end |
#onSelectionBulkChange(selection) ⇒ nil
The #onSelectionBulkChange method is called whenever items are added or removed from the selection set.
The #onSelectionBulkChange callback will not trigger if the selection is cleared by clicking on empty model space. Use the #onSelectionCleared method to catch this case.
64 65 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb', line 64 def onSelectionBulkChange(selection) end |
#onSelectionCleared(selection) ⇒ nil
The #onSelectionCleared method is called when the selection is completely emptied.
80 81 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb', line 80 def onSelectionCleared(selection) end |
#onSelectionRemoved(selection, entity) ⇒ nil
Due to a bug in SketchUp this event doesn’t trigger. Instead onSelectedRemoved is called.
112 113 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb', line 112 def onSelectionRemoved(selection, entity) end |