'******************************************************************* ' class_Snap '******************************************************************* Dim Lib As New Class_Lib Dim Arcmap As New Class_Arcmap Dim G As New Class_Arcmap_Graphic Dim Text As New Class_Text '=================================================================== ' test '=================================================================== Public Sub Test() Dim p1 As IPoint Dim p2 As IPoint Dim P3 As IPoint Dim Angle As Double Dim Length As Double If (Not G.FindLayer("mains")) Then MsgBox ("MAINS feature not found") Exit Sub End If If (Not G.OpenSelected()) Then MsgBox "No MAINS were selected" Exit Sub End If G.Read Set p1 = G.Point(1) Set p2 = G.Point(2) Angle = Lib.Angle(p1, p2) Length = Lib.Length(p1, p2) Set P3 = New Point P3.x = Length / 2 P3.y = 0 Lib.RotatePoint P3, Angle Lib.MovePointFromOrigin P3, p1 Text.Point = P3 Text.Angle = Lib.ReadAngle(Angle) Text.Text = Round(Length) Text.Just = "LC" ' Text.BaseScale = 4000 Text.DrawScreen End Sub