123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::CRSLocation

Relationships
Inherits: Object

Overview

The CRSLocation class contains information that maps the SketchUp model into a projection coordinate system.

Version:

  • SketchUp 2027.0

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new ⇒ CRSLocation .new(crslocation) ⇒ CRSLocation

Creates a CRSLocation object.

Examples:

# No arguments, creates an empty CRSLocation
crs_location1 = Sketchup::CRSLocation.new

# Creates a clone of the CRSLocation
crs_location2 = Sketchup::CRSLocation.new(crs_location1)

Sketchup.active_model.crs_location = crs_location2

Overloads:

  • .new ⇒ CRSLocation
  • .new(crslocation) ⇒ CRSLocation

    Parameters:

    • crs_location (CRSLocation)

Version:

  • SketchUp 2027.0

Instance Attribute Details

#calibration_file_name ⇒ String? (rw)

The #calibration_file_name method is used to retrieve the name of the calibration file used in the construction of the CRSLocation.

Version:

  • SketchUp 2027.0

#calibration_file_name=(calibration_file_name) (rw)

The #calibration_file_name= method is used to set the name of the calibration file used in the construction of the CRSLocation.

Parameters:

  • calibration_file_name (String, nil)

Version:

  • SketchUp 2027.0

#description ⇒ String? (rw)

The #description method is used to retrieve the description of the CRSLocation.

Examples:

Sketchup.active_model.crs_location.description

Version:

  • SketchUp 2027.0

#description=(description) (rw)

The #description= method is used to set the description of the CRSLocation.

Examples:

Sketchup.active_model.crs_location.description = "British National Grid"

Parameters:

Version:

  • SketchUp 2027.0

#eastings ⇒ Float (rw)

The #eastings method is used to retrieve the eastings of the CRSLocation.

The eastings represents the offset in the "X" direction of this models origin from the origin of the coordinate system

Version:

  • SketchUp 2027.0

#eastings=(eastings) ⇒ Float (rw)

The #eastings= method is used to set the eastings of the CRSLocation.

Typically #eastings, #northings and #height need to be set together to properly position the model.

Version:

  • SketchUp 2027.0

#geodetic_datum ⇒ String? (rw)

The #geodetic_datum method is used to retrieve the name of the geodetic datum of the CRSLocation.

Version:

  • SketchUp 2027.0

#geodetic_datum=(geodetic_datum) (rw)

Note:

If the #name is specific enough this may be unnecessary to set.

The #geodetic_datum= method is used to set the name of the geodetic datum of the CRSLocation.

Parameters:

  • geodetic_datum (String, nil)

Version:

  • SketchUp 2027.0

#height ⇒ Float (rw)

Note:

this is equivalent to "Orthogonal Height" from the IFC spec.

The #height method is used to retrieve the height of the CRSLocation.

The height represents the offset in the "Z" direction of this models origin from some base height.

Version:

  • SketchUp 2027.0

#height=(height) ⇒ Float (rw)

The #height= method is used to set the height of the CRSLocation.

Typically #eastings, #northings and #height need to be set together to properly position the model.

Version:

  • SketchUp 2027.0

#map_projection ⇒ String? (rw)

The #map_projection method is used to retrieve the name of the map projection of the CRSLocation.

Version:

  • SketchUp 2027.0

#map_projection=(map_projection) (rw)

Note:

If the #name is specific enough this may be unnecessary to set.

The #map_projection= method is used to set the name of the map projection of the CRSLocation.

Parameters:

  • map_projection (String, nil)

Version:

  • SketchUp 2027.0

#map_unit ⇒ Sketchup::CRSMapUnit? (rw)

Note:

If there is no map unit defined, meters can be assumed.

The #map_unit method is used to retrieve the map unit of the CRSLocation.

Version:

  • SketchUp 2027.0

#map_unit=(map_unit) (rw)

The #map_unit= method is used to set the map unit of the CRSLocation.

Parameters:

See Also:

Version:

  • SketchUp 2027.0

#map_zone ⇒ String? (rw)

The #map_zone method is used to retrieve the name of the map zone of the CRSLocation.

Version:

  • SketchUp 2027.0

#map_zone=(map_zone) (rw)

Note:

If the #name is specific enough this may be unnecessary to set.

The #map_zone= method is used to set the name of the map zone of the CRSLocation.

Parameters:

Version:

  • SketchUp 2027.0

#name ⇒ String (rw)

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

Version:

  • SketchUp 2027.0

#name=(name) (rw)

The #name= method is used to set the name of the CRSLocation.

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

Examples:

Sketchup.active_model.crs_location.name = "EPSG:27700"

Parameters:

Version:

  • SketchUp 2027.0

#northings ⇒ Float (rw)

The #northings method is used to retrieve the northings of the CRSLocation.

The northings represents the offset in the "Y" direction of this models origin from the origin of the coordinate system

Version:

  • SketchUp 2027.0

#northings=(northings) ⇒ Float (rw)

The #northings= method is used to set the northings of the CRSLocation.

Typically #eastings, #northings and #height need to be set together to properly position the model.

Version:

  • SketchUp 2027.0

#scale ⇒ Float (rw)

Note:

The #scale and #map_unit properties are related.

The #scale method is used to retrieve the scale of the CRSLocation.

The scale represents the ratio between the ::Sketchup modelling units (inches) and the modelling units of the coordinate system.

For example, if the CRS is in meters, the scale would be 1.m

See Also:

Version:

  • SketchUp 2027.0

#scale=(scale) (rw)

Note:

When calling this method also considering calling #map_unit=

The #scale= method is used to set the scale of the CRSLocation.

Examples:

crs_location = model.crs_location
crs_location.scale = Sketchup::CRSLocation::FEET
# Alternatively:
crs_location.scale = 1.to_feet

Parameters:

  • scale

Raises:

  • (ArgumentError) —

    If the scale is less than or equal to 0.

See Also:

Version:

  • SketchUp 2027.0

#tgl_id ⇒ String? (rw)

The #tgl_id method is used to retrieve the TGL (Trimble Geodetic Library) ID of the CRSLocation.

This ID encodes all of the information about the CRS in a compact encoded string.

See Also:

Version:

  • SketchUp 2027.0

#tgl_id=(tgl_id) (rw)

Note:

This is currently a mandatory field when setting the CRSLocation on the model.

The #tgl_id= method is used to set the TGL (Trimble Geodetic Library) ID of the CRSLocation.

Parameters:

See Also:

Version:

  • SketchUp 2027.0

#vertical_datum ⇒ String? (rw)

The #vertical_datum method is used to retrieve the name of the vertical datum of the CRSLocation.

Version:

  • SketchUp 2027.0

#vertical_datum=(vertical_datum) (rw)

Note:

If the #name is specific enough this may be unnecessary to set.

The #vertical_datum= method is used to set the name of the vertical datum of the CRSLocation.

Parameters:

  • vertical_datum (String, nil)

Version:

  • SketchUp 2027.0

#x_axis ⇒ Geom::Vector2d (rw)

The #x_axis method is used to retrieve the x_axis of the CRSLocation.

The x_axis represents the direction of the local "X" axis in terms of the coordinate system.

The default value is (1, 0), which means that the local orientation matches the coordinate system.

Version:

  • SketchUp 2027.0

#x_axis=(x_axis) (rw)

The #x_axis= method is used to set the x_axis of the CRSLocation.

Examples:

Orienting the model so that the local "X" axis points north:

model = Sketchup.active_model
crs_location = model.crs_location
crs_location.x_axis = [0, 1]
model.crs_location = crs_location

Parameters:

Version:

  • SketchUp 2027.0

Instance Method Details

#==(other) ⇒ Boolean

The #== method returns whether two CRSLocation are equal within tolerance.

Parameters:

  • other (CRSLocation)

Version:

  • SketchUp 2027.0

#to_s ⇒ String

The #to_s method converts a CRSLocation object to a ::String.

Examples:

crs_location = Sketchup::CRSLocation.new
str = crs_location.to_s

Version:

  • SketchUp 2027.0