Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Recent pages and files
Ruby-MaterialsObserver.html    

MaterialsObserver interface

This observer interface is implemented to react to materials 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: onMaterialAdd, onMaterialChange, onMaterialRemove, onMaterialRefChange, onMaterialSetCurrent, onMaterialUndoRedo, onMaterialRemoveAll

Example code:  

Instance Methods


onMaterialAdd

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

 

Example

 

 

 


onMaterialChange

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

 

Example

 

 

 

 

 


onMaterialRemove

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

 

Example

 

 

 


onMaterialRefChange

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

 

Example

 

 

 


onMaterialSetCurrent

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

 

Example

 

 

 


onMaterialUndoRedo

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

 

Example

 

 

 


onMaterialRemoveAll

 

Syntax

 

Arguments

materials - a Materials object.

material - a Material object.

Return Value

 

Comments

V6: There is a bug in this callback method where it is called too often.   You should ignore this method call if it's immediately preceded by a "setcurrent" notification.

Example

 

 

SketchUp  Ruby API Reference: MaterialsObserver interface

© Google Inc. 2006 sketchup.google.com

  
 

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google