HOW TO
Instructions provide a sample Avenue code to display Degrees, Minutes, and Seconds values in ArcView's status bar when moving the cursor around in the view. The vector data in the view must be stored in a geographic coordinate system. The View Properties Projection setting can be a projected coordinate system or a geographic coordinate system.
Code:
' Display Degree-Minutes-Seconds
'
' attach this script to a tool apply property'
theView = av.Getactivedoc
p = theView.GetDisplay.ReturnUserPoint
if ((theview.getprojection.asstring = "").not) then
p = p.returnUnprojected(theview.getprojection)
end
x = p.GetX
y = p.GetY
xdeg = x.truncate
x2 = (x - xdeg).abs
xm = x2*(60)
xmin = xm.truncate.setformat("dd.")
xs = xm - xmin
xsec = (xs*(60)).setformat("dd.dd")
ydeg = y.truncate
y2 = (y - ydeg).abs
ym = y2*(60)
ymin = ym.truncate.setformat("dd.")
ys = ym - ymin
ysec = (ys*(60)).setformat("dd.dd")
lat = xdeg.asstring+" "+xmin.asstring+"' "+xsec.asstring+"''"
lon = ydeg.asstring+" "+ymin.asstring+"' "+ysec.asstring+"''"
msg = ("Position = "+lon+", "+lat)
av.ShowMsg(msg)
System.RefreshWindows
av.DelayedRun(script.the.getname, nil, 0.5)
Note:
Click the new tool and pan the View to display the Degrees, Minutes, and Seconds values in ArcView's status bar.
Article ID:000005243
Get help from ArcGIS experts
Download the Esri Support App