Class: Sketchup::DimensionObserver 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 dimensions of interest.

This observer interface is implemented to react to changes in dimension text.

Examples:

# This is an example of a DimensionObserver
class MyDimensionObserver < Sketchup::DimensionObserver
  def onTextChanged(dimension)
    puts "onTextChanged: #{dimension}, new_text= #{dimension.text}"
  end
end

# Attach the observer. (Assumes there is a dimension in the model root.)
dim = Sketchup.active_model.entities.grep(Sketchup::Dimension).first
dim.add_observer(MyDimensionObserver.new)

Version:

  • SketchUp 2014

Instance Method Summary # collapse

Instance Method Details

#onTextChanged(dimension) ⇒ Object

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

Examples:

def onTextChanged(dimension)
  puts "onTextChanged: #{dimension}, new_text= #{dimension.text}"
end

Parameters:

Version:

  • SketchUp 2014