123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::PagesObserver Abstract

Relationships
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Sketchup::EntitiesObserver

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

EntitiesObserver - Inherited

#onActiveSectionPlaneChanged

The #onActiveSectionPlaneChanged method is invoked when a section plane within this entities is activated or the active one is deactivated.

#onElementAdded

The onElementAdded method is invoked when a single element is added to the Entities collection.

#onElementModified

The #onElementModified method is invoked whenever one or more elements in the collection are modified.

#onElementRemoved

The #onElementRemoved method is invoked when a single element is removed from the Entities collection.

#onEraseEntities

The #onEraseEntities method is invoked when one or more entities are erased.

Instance Method Details

#onContentsModified(pages) ⇒ nil

The #onContentsModified method is invoked whenever the pages change.

Examples:

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

Parameters:

Version:

  • SketchUp 6.0

#onElementAdded(pages, page) ⇒ nil

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

Examples:

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

Parameters:

Version:

  • SketchUp 6.0

#onElementRemoved(pages, page) ⇒ nil

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

Examples:

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

Parameters:

Version:

  • SketchUp 6.0