ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::Dimension

Overview

Base class for dimensions. Direct construction with new is unsupported. For linear dimensions see ModraUp::DimensionLinear.

Examples:

dim = ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5])
dim.is_a?(ModraUp::Dimension)

Constants # collapse

ModraUp::Dimension::ARROW_NONE

#arrow_type: No arrow.

Returns:

  • (Integer)

Examples:

ModraUp::Dimension::ARROW_NONE  #=> 0
ModraUp::Dimension::ARROW_SLASH

#arrow_type: Slash (default).

Returns:

  • (Integer)

Examples:

ModraUp::Dimension::ARROW_SLASH  #=> 1
ModraUp::Dimension::ARROW_DOT

#arrow_type: Dot.

Returns:

  • (Integer)

Examples:

ModraUp::Dimension::ARROW_DOT  #=> 2
ModraUp::Dimension::ARROW_CLOSED

#arrow_type: Solid arrow.

Returns:

  • (Integer)

Examples:

ModraUp::Dimension::ARROW_CLOSED  #=> 3
ModraUp::Dimension::ARROW_OPEN

#arrow_type: Hollow arrow.

Returns:

  • (Integer)

Examples:

ModraUp::Dimension::ARROW_OPEN  #=> 4

Instance Method Summary # collapse

Inherited from ModraUp::Drawingelement

Inherited from ModraUp::Entity

Instance Method Details

dimension.arrow_type ⇒ Integer

Returns:

  • (Integer)

Examples:

dim = ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5])
dim.arrow_type == ModraUp::Dimension::ARROW_SLASH

dimension.arrow_type=(type) ⇒ type

Sets the arrow style.

Parameters:

  • type (Integer)

Returns:

  • (Integer)

Raises:

  • [ArgumentError] not in the range 0–4

Examples:

dim = ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5])
dim.arrow_type = ModraUp::Dimension::ARROW_CLOSED

dimension.has_aligned_text? ⇒ Boolean

Does the text align along the dimension line? If not, it faces the screen.

Returns:

  • (Boolean)

Examples:

ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5]).has_aligned_text?

dimension.has_aligned_text=(aligned) ⇒ Boolean

Sets whether the text is aligned along the dimension line.

Parameters:

  • aligned (Boolean)

Returns:

  • (Boolean)

Examples:

dim = ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5])
dim.has_aligned_text = false

dimension.text ⇒ String

The current display of dimension text (formatted in model units for measured length).

Returns:

  • (String)

Examples:

dim = ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5])
dim.text

dimension.plane ⇒ Array(Float, Float, Float, Float)

Plane on which the dimension lies [a, b, c, d] (ax + by + cz + d = 0).

Returns:

  • (Array<Float>)

Examples:

dim = ModraUp.active_model.entities.add_dimension_linear(
  [0, 0, 0], [10, 0, 0], [0, 0, 5])
dim.plane.length  #=> 4