Class: Sketchup::CRSMapUnit

Inherits:
Object
  • Object
show all

Overview

The CRSMapUnit class represents a length unit and the conversion factor from that unit to meters.

Version:

  • SketchUp 2027.0

Constants for CRS MapUnits # collapse

Sketchup::CRSMapUnit::METERS
Sketchup::CRSMapUnit::FEET
Sketchup::CRSMapUnit::US_SURVEY_FEET

Instance Method Summary # collapse

Constructor Details

↑ #initialize(name, conversion) ⇒ Sketchup::CRSMapUnit

Creates a CRSMapUnit object.

Examples:

map_unit = Sketchup::CRSMapUnit.new("METRE", 1.0)

Parameters:

  • name (String)
  • conversion (Float)

Raises:

  • (ArgumentError) —

    If name is empty or conversion is <= 0.

Version:

  • SketchUp 2027.0

Instance Method Details

↑ #==(other) ⇒ Boolean

The #== method returns whether two Sketchup::CRSMapUnit are equal within tolerance.

Parameters:

Returns:

  • (Boolean)

Version:

  • SketchUp 2027.0

↑ #conversion ⇒ Float

The #conversion method is used to retrieve the conversion factor between this map unit and meters.

Returns:

  • (Float)

Version:

  • SketchUp 2027.0

↑ #inspect ⇒ String

The #inspect method returns a string representation of the CRSMapUnit.

Returns:

Version:

  • SketchUp 2027.0

↑ #name ⇒ String

Note:

For best interoperability with other BIM and GIS software this should follow the IFC

The #name method is used to retrieve the name of the CRSMapUnit.

standard.

Returns:

Version:

  • SketchUp 2027.0

↑ #to_s ⇒ String

The #to_s method returns a string containing a human-readable representation of the CRSMapUnit.

Returns:

Version:

  • SketchUp 2027.0