Class: Sketchup::PagesObserver Abstract

Inherits:
EntitiesObserver show all

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 objects of interests.

This observer interface is implemented to react to pages events.

Examples:

# This is an example of an observer that watches the pages for new ones.
class MyPagesObserver < Sketchup::PagesObserver
  def onElementAdded(pages, page)
    puts "onElementAdded: #{page}"
  end
end

# Attach the observer.
Sketchup.active_model.pages.add_observer(MyPagesObserver.new)

Version:

  • SketchUp 6.0

Instance Method Summary # collapse

Methods inherited from EntitiesObserver

#onActiveSectionPlaneChanged, #onElementModified, #onEraseEntities

Instance Method Details

#onContentsModified(pages) ⇒ nil

The #onContentsModified method is invoked whenever the pages change.

Examples:

def onContentsModified(pages)
  puts "onContentsModified: #{pages}"
end

Parameters:

Returns:

  • (nil)

Version:

  • SketchUp 6.0

#onElementAdded(pages, page) ⇒ nil

The #onElementAdded method is invoked when an element is added to a Sketchup::Pages object.

Examples:

def onElementAdded(pages, page)
  puts "onElementAdded: #{page}"
end

Parameters:

Returns:

  • (nil)

Version:

  • SketchUp 6.0

#onElementRemoved(pages, page) ⇒ nil

The #onElementRemoved method is invoked when an element is removed from a Sketchup::Pages object.

Examples:

def onElementRemoved(pages, page)
  puts "onElementRemoved: #{page}"
end

Parameters:

Returns:

  • (nil)

Version:

  • SketchUp 6.0