SketchUp  Ruby API Reference 

Class Index

Method Index

Developers Guide

Examples

AppObserver interface

This observer interface is implemented to react to SketchUp-level 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: onQuit, onNewModel, onOpenModel

Example code:   

Instance Methods


onQuit

The onQuite method is called when SketchUp quits.

 

Syntax

 

Arguments

 

Return Value

 

Comments

 

Example

 

 

 


onNewModel

The onNewModel method is called when a new model is to be created (File > New).

 

Syntax

 

Arguments

 

Return Value

 

Comments

 

Example

 

 

 


onOpenModel

The onOpenModel method is called when you open a model (File > Open).

Syntax

 

Arguments

 

Return Value

 

Comments

 

Example

 

 

SketchUp  Ruby API Reference: AppObserver interface

© Google Inc. 2006 sketchup.google.com