Class: Sketchup::DimensionObserver

Inherits:
Object
  • Object
show all

Overview

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