HOW TO

Display Degrees, Minutes, and Seconds in ArcView's status bar

Last Published: April 25, 2020

Summary

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.

Procedure



  1. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Copy the following code into the new script window.
    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)

  3. Click the compile button.
    [O-Image] Script compile button
  4. With the Project Window active, open the Customize dialog box by going to Project > Customize.
  5. Set the Type to View and the Category to Tool.
  6. Click the Tool button to create a new tool.
  7. With the new tool selected, double-click to the right of 'Apply' to bring up the Script Manager.
  8. Browse through the Script Manager and select the name of the script created in Step #1.
  9. Close the Customize dialog box and there is a new tool on the View GUI associated with this script.

    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

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic