Item Type Expression to Get Latitude / Longitude


  Product(s): MicroStation  
  Version(s): MCE, MS23, MS24  
  Environment: N\A  
  Area: Properties  
  Subarea: Item Types  

Item Type Expression to Get Latitude / Longitude

Background

Request from User:
Is it possible to get Latitude and Longitude in an Item type via expression.

 

Steps to Accomplish

Coordinates.GCS is available with the following functions.

GetLatitude (Point)
GetLongtitude (Point)
GetElevation (Point)

 

In the following expressions we are passing Cell Origin to extract Latitude, Longitude and Elevation values.

Coordinates.GCS.GetLatitude(this.GetElement().Origin)
Coordinates.GCS.GetLongitude(this.GetElement().Origin)
Coordinates.GCS.GetElevation(this.GetElement().Origin)

 

Following expressions can be used for Line, Point elements.

Coordinates.GCS.GetLatitude(this.GetElement().Segments[0].Start)
Coordinates.GCS.GetLongitude(this.GetElement().Segments[0].Start)
Coordinates.GCS.GetElevation(this.GetElement().Segments[0].Start)

 

Sample DGN File

 

 

 

See Also

Item Type Expressions

Other language sources

 

  Original Author: Leonard Jones