123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::ViewObserver Abstract

Relationships
Inherits: Object

Overview

This class is abstract.

To implement this observer, create a Ruby class of this type, override the desired methods, and add an instance of the observer to the view object.

This observer interface is implemented to react to view events.

Examples:

# This is an example of an observer that watches tool interactions.
class MyViewObserver < Sketchup::ViewObserver
  def onViewChanged(view)
    puts "onViewChanged: #{view}"
  end
end

# Attach the observer.
Sketchup.active_model.active_view.add_observer(MyViewObserver.new)

Version:

  • SketchUp 6.0

Instance Method Summary

Instance Method Details

#onViewChanged(view) ⇒ nil

The #onViewChanged method is called whenever the view is altered, such as when the user uses the Pan, Orbit, or Zoom tools are used.

Examples:

def onViewChanged(view)
  puts "onViewChanged: #{view}"
end

Parameters:

Version:

  • SketchUp 6.0