My favorites | English | Sign in

Google SketchUp Ruby API

LatLong

class

Parent: Object

Introduction

SketchUp 6.0+

The LatLong class contains various methods for creating and manipulating latitude and longitude coordinates.

Methods

LatLong.latitudeSketchUp 6.0+

The Latitude method retrieves the latitude coordinate from a LatLong object.

Returns:

latitude
a latitude coordinate value
 ll = [40.01700, 105.28300]
 latlong = Geom::LatLong.new(ll)
 latitude = latlong.latitude
 if (latitude)
   UI.messagebox latitude
 else
   UI.messagebox "Failure"
 end

LatLong.longitudeSketchUp 6.0+

The Latitude method retrieves the longitude coordinate from a LatLong object.

Returns:

longitude
a latitude coordinate value
 ll = [40.01700, 105.28300]
 latlong = Geom::LatLong.new(ll)
 longitude = latlong.longitude
 if (longitude)
   UI.messagebox longitude
 else
   UI.messagebox "Failure"
 end

LatLong.newSketchUp 6.0+

The new method creates a LatLong object.

Arguments:

latlong
A latitude and longitude coordinate set as an Array.

Returns:

latlong
a LatLong object
 ll = [40.01700, 105.28300]
 latlong = Geom::LatLong.new(ll)
 if (latlong)
   UI.messagebox latlong
 else
   UI.messagebox "Failure"
 end

LatLong.to_aSketchUp 6.0+

The to_a method converts a LatLong object to an array of two values.

Returns:

array
an array of two values: latitude and longitude
 ll = [40.01700, 105.28300]
 latlong = Geom::LatLong.new(ll)
 a = latlong.to_a
 if (a)
   UI.messagebox a
 else
   UI.messagebox "Failure"
 end

LatLong.to_sSketchUp 6.0+

The to_a method converts a LatLong object to a string.

Returns:

string
a string representation of a LatLong object
 ll = [40.01700, 105.28300]
 latlong = Geom::LatLong.new(ll)
 s = latlong.to_s
 if (s)
   UI.messagebox s
 else
   UI.messagebox "Failure"
 end

LatLong.to_utmSketchUp 6.0+

The to_utm method converts a LatLong object to an array of two values.

Returns:

array
an array of two values: latitude and longitude
 ll = [40.01700, 105.28300]
 latlong = Geom::LatLong.new(ll)
 utm = latlong.to_utm
 if (utm)
   UI.messagebox utm
 else
   UI.messagebox "Failure"
 end