My favorites | English | Sign in

Google SketchUp Ruby API

RenderingOptionsObserver

interface

Parent: Object

Introduction

SketchUp 6.0+

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.

     # This is an example of an observer that watches the rendering options
     # for changes.
     class MyRenderingOptionsObserver < Sketchup::RenderingOptionsObserver
       def onRenderingOptionsChanged(renderoptions, type)
         UI.messagebox("onRenderingOptionsChanged: " + renderoptions.to_s + ',' + type.to_s)
       end
     end

     # Attach the observer.
     rendering_options = Sketchup.active_model.rendering_options
     rendering_options.add_observer(MyRenderingOptionsObserver.new)

Methods

RenderingOptionsObserver.onRenderingOptionsChangedSketchUp 6.0+

The onRenderingOptionsChanged method is invoked whenever the user changes their rendering options.

The type is an internal number that indicates what was changed. You will need to watch the observer for numbers you are interested in.

Arguments:

renderoptions
A RenderingOptions object.
type
A number indicating the option that was changed.

Returns:

nil
 def onRenderingOptionsChanged(renderoptions, type)
   UI.messagebox("onRenderingOptionsChanged: " + type.to_s)
 end