class Sketchup::Dimension

The Dimension class provides base functionality for classes DimensionLinear and DimensionRadial. It's not instantiable.

@version SketchUp 2014

Constants

ARROW_CLOSED

Constants

ARROW_DOT
ARROW_NONE
ARROW_OPEN
ARROW_SLASH

Public Instance Methods

add_observer(observer) click to toggle source

The add_observer method is used to add a DimensionObserver to the dimension.

@example

observer = MyDimObserver.new
dim = Sketchup.active_model.entities.add_dimension_linear([50, 10, 0],
      [100, 10, 0], [0, 20, 0])
status = dim.add_observer(observer)

@note If the given observer responds to onTextChanged, it will be

added as a {Sketchup::DimensionObserver}. If not, the base
{Sketchup::Entity#add_observer} will be called.

@param observer

A DimensionObserver.

@return true if successful, false if unsuccessful.

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 38
def add_observer(observer)
end
arrow_type() click to toggle source

The arrow_type method retrieves the current arrow type of the dimension. Valid arrow types are class constants:

  • Dimension::ARROW_NONE,

  • Dimension::ARROW_SLASH

  • Dimension::ARROW_DOT

  • Dimension::ARROW_CLOSED

  • Dimension::ARROW_OPEN

@example

type = dim.arrow_type
if type == Sketchup::Dimension::ARROW_CLOSED
  puts "Arrow type is closed"
end

@return a numerical representation of the arrow type

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 58
def arrow_type
end
arrow_type=(type) click to toggle source

The arrow_type= method sets the arrow type of the dimension. Valid arrow types are class constants:

  • Dimension::ARROW_NONE,

  • Dimension::ARROW_SLASH

  • Dimension::ARROW_DOT

  • Dimension::ARROW_CLOSED

  • Dimension::ARROW_OPEN

@example

dim.arrow_type = Sketchup::Dimension::ARROW_CLOSED

@param type

a numerical representation of the arrow type.

@return the arrow type that was set.

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 78
def arrow_type=(type)
end
has_aligned_text=(value) click to toggle source

The has_aligned_text= method accepts true or false indicating whether the dimension's text is aligned to the dimension or to the screen.

@example

dim.has_aligned_text = true

@param [Boolean] value

@return the alignment flag that was set

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 92
def has_aligned_text=(value)
end
has_aligned_text?() click to toggle source

The has_aligned_text method is used to determine whether the dimension's text is aligned to the dimension or to the screen.

@example

aligned = dim.has_aligned_text?

@return [Boolean] status - true if text is aligned to the dimension.

False if dimension text is aligned to the screen.

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 105
def has_aligned_text?
end
plane() click to toggle source

The plane method is used to retrieve the plane of the dimension. Refer to the Geom module for information on how planes are represented.

@example

plane = dim.plane

@return the plane of the dimension

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 117
def plane
end
remove_observer(observer) click to toggle source

The remove_observer method is used to remove a DimensionObserver from the dimension. Note that, if the given observer responds to 'onTextChanged', it will be removed as a DimensionObserver. If not, the base Entity.remove_observer will be called.

@example

observer = MyDimObserver.new
dim = Sketchup.active_model.entities.add_dimension_linear([50, 10, 0],
      [100, 10, 0], [0, 20, 0])
status = dim.add_observer(observer)
status = dim.remove_observer(observer)

@param observer

A DimensionObserver.

@return true if successful, false if unsuccessful.

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 138
def remove_observer(observer)
end
text() click to toggle source

The text method is used to retrieve the dimension text.

@example

dimtext = dim.text

@return the dimension text

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 149
def text
end
text=(text) click to toggle source

The text= method is used to set an override on the dimension text.

@example

dim.text= "text"

@param [String] text

@return the newly set text override

@version SketchUp 2014

# File lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb, line 162
def text=(text)
end