' Name: View_ShowCoordinatesDD
'
' Title: Show coordinates of last mouse click in decimal degrees and in x, y
'
' Topics: Views
'
' Description: Show coordinates of last mouse click in decimal degrees and in x, y
'
' Author: Michael Silberbauer 2001-10-10
' Institute for Water Quality Studies, Department of Water and Sanitation
' Private Bag X313 PRETORIA South Africa 0001
' SilberbauerM@dwaf.gov.za
'
' Requires: A View - works best as a button
'
' Self:
'
' Results:
' -----------------------------------------------------------------------------

theView = av.GetActiveDoc
theDisplay = theView.GetDisplay
thePrj = theView.GetProjection
'MsgBox.Info( thePrj.asString, "Projection" )
' Get the GraphicList for the View...

theGraphics = theView.GetGraphics

'prjpoint        = geopoint.ReturnProjected( thePrj )
'p = theView.GetDisplay.ReturnUserPoint.ReturnUnprojected(thePrj)
'theView.ReturnUserRect

prjpoint = theDisplay.ReturnUserPoint
x = prjpoint.GetX.SetFormat("d")
y = prjpoint.GetY.SetFormat("d")
ppoint = prjpoint.ReturnUnprojected(thePrj)
lon = ppoint.GetX.SetFormat("d.dddddd")
lat = ppoint.GetY.SetFormat("d.dddddd")
MsgBox.Info(lon.AsString++lat.AsString++x.AsString++y.AsString,"User point and projected")