SketchUp  Ruby API Reference 

Class Index

Method Index

Developers Guide

Examples

SelectionObserver interface

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.

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:  onSelectionAdded, onSelectionBulkChange, onSelectionCleared, onSelectionRemoved 

Example code:   

Instance Methods


onSelectionAdded

 

Syntax

 

Arguments

 selection - a Selection object.

Element - an Drawingelement object added to the selection.

Return Value

 

Comments

 

Example

 

 

 


onSelectionBulkChange

 

Syntax

 

Arguments

selection - a Selection object.

Return Value

 

Comments

 

Example

 

 

 


onSelectionCleared

 

Syntax

 

Arguments

selection - a Selection object.

Return Value

 

Comments

 

Example

 

 

 


onSelectionRemoved

 

Syntax

 

Arguments

selection - a Selection object.

Element -

 

Return Value

 

Comments

 

Example

 

 

 

 

SketchUp  Ruby API Reference: SelectionObserver interface

© Google Inc. 2007 sketchup.google.com