HOW TO
Code:
'Script: aaPoint
'
theView = av.getactivedoc
theGL = theView.GetGraphics
theDisplay = theView.GetDisplay
_p1 = theDisplay.ReturnUserPoint
_pg1 = GraphicShape.Make(_p1)
theGL.Add(_pg1)
_pg1.Invalidate
_angle = 0
av.DelayedRun("aaPaint", nil, 1)
'
'End of Script: aaPoint
Code:
'Script: aaPaint
'
theView = av.GetActiveDoc
p2 = theView.GetDisplay.ReturnUserPoint
x1 = _p1.GetX
y1 = _p1.GetY
x2 = p2.GetX
y2 = p2.GetY
for each i in 0..0
if ((x1=x2)and(y1<y2))
then
_angle = 0
break
end
if ((x1=x2)and(y1>y2))
then
_angle = 180
break
end
if ((y1=y2)and(x1<x2))
then
_angle = 90
break
end
if ((y1=y2)and(x1>x2))
then
_angle = 270
break
end
if ((x1<x2)and(y1<y2)) then
_angle =
(((x1-x2).Abs)/((y1-y2).Abs)).atan.AsDegrees
end
if ((x1<x2)and(y1>y2)) then
_angle =
(((y1-y2).Abs)/((x1-x2).Abs)).atan.AsDegrees + 90
end
if ((x1>x2)and(y1>y2)) then
_angle =
(((x1-x2).Abs)/((y1-y2).Abs)).atan.Asdegrees + 180
end
if ((x1>x2)and(y1<y2)) then
_angle =
(((y1-y2).Abs)/((x1-x2).Abs)).atan.asDegrees +270
end
end
av.ShowMsg(_angle.SetFormat("d.dd").AsString ++ "degrees")
System.RefreshWindows
av.Run("aaTimer",nil)
'
'End of Script: aaPaint
Code:
'Script: aaTimer.ave
'
if (av.getactivedoc.AsString = "View1")
then
av.DelayedRun("aaPaint", nil, 0.5)
end
'
'End of Script: aaTimer.ave
Article ID:000001466
Get help from ArcGIS experts
Download the Esri Support App