# How To: Measure azimuth in degrees in your view

## Procedure

Summary

The scripts in this document allow you to measure azimuth in degrees between points in a view.

Solution

These scripts use a point graphic and the ArcView status bar to perform the measurement.

1. Open three new script windows.

2. Copy each of the scripts below into a script window.

3. Select Properties from the Script menu and rename each script; aaPoint, aaPaint, and aaTimer respectively.

4. Assign the aaPoint script to the "Apply" property of a new tool on the View GUI.

5. Click the New tool and then click anywhere in the View. The script will place a graphic point where you clicked. The status bar will dynamically display the azimuth in degrees between the graphic point and the current location of the cursor.

`Code:'Script:  aaPoint'theView = av.getactivedoctheGL = theView.GetGraphicstheDisplay = theView.GetDisplay_p1 = theDisplay.ReturnUserPoint_pg1 = GraphicShape.Make(_p1)theGL.Add(_pg1)_pg1.Invalidate_angle = 0av.DelayedRun("aaPaint", nil, 1)''End of Script:  aaPoint`

`Code:'Script:  aaPaint'theView = av.GetActiveDocp2 = theView.GetDisplay.ReturnUserPointx1 = _p1.GetXy1 = _p1.GetYx2 = p2.GetXy2 = p2.GetYfor each i in 0..0if ((x1=x2)and(y1<y2)) then    _angle = 0 break  endif ((x1=x2)and(y1>y2)) then    _angle = 180 break  endif ((y1=y2)and(x1<x2)) then    _angle = 90 break  endif ((y1=y2)and(x1>x2)) then    _angle = 270 break  endif ((x1<x2)and(y1<y2)) then _angle = (((x1-x2).Abs)/((y1-y2).Abs)).atan.AsDegreesendif ((x1<x2)and(y1>y2)) then _angle = (((y1-y2).Abs)/((x1-x2).Abs)).atan.AsDegrees + 90endif ((x1>x2)and(y1>y2)) then _angle =(((x1-x2).Abs)/((y1-y2).Abs)).atan.Asdegrees + 180endif ((x1>x2)and(y1<y2)) then _angle = (((y1-y2).Abs)/((x1-x2).Abs)).atan.asDegrees +270endendav.ShowMsg(_angle.SetFormat("d.dd").AsString ++ "degrees")System.RefreshWindowsav.Run("aaTimer",nil)''End of Script:  aaPaint`

`Code:'Script:  aaTimer.ave'if (av.getactivedoc.AsString = "View1")thenav.DelayedRun("aaPaint", nil, 0.5)end''End of Script:  aaTimer.ave`