Class: Sketchup::EntityObserver Abstract

Inherits:
Object
  • Object
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 entity of interests.

This observer interface is implemented to react to entity events.

Examples:

class MyEntityObserver < Sketchup::EntityObserver
  def onEraseEntity(entity)
    puts "onEraseEntity: #{entity}"
  end
end

# Attach the observer. (Assumes there is an entity in the model.)
Sketchup.active_model.entities[0].add_observer(MyEntityObserver.new)

Version:

  • SketchUp 6.0

Direct Known Subclasses

DefinitionObserver, InstanceObserver

Instance Method Summary # collapse

Instance Method Details

#onChangeEntity(entity) ⇒ nil

The #onChangeEntity method is invoked when your entity is modified.

Examples:

def onChangeEntity(entity)
  puts "onChangeEntity: #{entity}"
end

Parameters:

Returns:

  • (nil)

Version:

  • SketchUp 6.0

#onEraseEntity(entity) ⇒ nil

The #onEraseEntity method is invoked when your entity is erased.

Examples:

def onEraseEntity(entity)
  puts "onEraseEntity: #{entity}"
end

Parameters:

Returns:

  • (nil)

Version:

  • SketchUp 6.0