Class: Sketchup::EntityObserver Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/entityobserver.rb

Overview

This class is abstract.

This is an abstract class - you need to over-write the methods in your code.

Attached to an Entity using the Sketchup::Entity#add_observer method

Examples:

# use a Ruby module as a namespace to avoid conflicts
module Namespace
    # Define a new observer class
    class MyEntityObserver < Sketchup::EntityObserver
        def onChangeEntity(entity)
        end
        def onEraseEntity(entity)
        end
    end
end
# Create a reference to a new observer (if it needs to be removed later.)
my_ent_obs = MyEntityObserver.new
# Attach the observer to a Group
grp.add_observer(my_ent_obs)
# ...Later, remove the observer
grp.remove_observer(my_ent_observer)

Direct Known Subclasses

DefinitionObserver, InstanceObserver

Instance Method Summary collapse

Instance Method Details

#onChangeEntity(entity) ⇒ nil

Parameters:

Returns:

  • (nil)


30
31
# File 'lib/entityobserver.rb', line 30

def onChangeEntity(entity)
end

#onEraseEntity(entity) ⇒ nil

Parameters:

Returns:

  • (nil)


35
36
# File 'lib/entityobserver.rb', line 35

def onEraseEntity(entity)
end