Modified Example

Land Auto

Modified Example

class Module Code:

Public WithEvents cogoPnts As AeccCogoPoints
    
Private Sub cogoPnts_Modified()
    
    MsgBox "Points have been modified", vbInformation, "Modified Example"
    
End Sub

Module Code:

Option Explicit
Dim eh As New EventHandler
    
Sub example_Modify_Event()
    
    ' This example establishes event handling for the CogoPoints object.
    Set eh.cogoPnts = AeccApplication.ActiveProject.CogoPoints
    
End Sub

Sub Example_Modify()
    
    ' This example change toggles the raw description of the first point
    ' in the collection to illustrate the Modify event.
    Dim cogoPnt As AeccCogoPoint
    Set cogoPnt = AeccApplication.ActiveProject.CogoPoints.Item(0)
    
    ' Get the points raw description
    Dim strName As String
    strName = cogoPnt.RawDescription
    
    ' Modify the raw description
    If cogoPnt.RawDescription = "Old Description" Then
        cogoPnt.RawDescription = "New Description"
    Else
        cogoPnt.RawDescription = "Old Description"
    End If
    
    ' Show the override description on the command line
    ThisDrawing.Utility.Prompt vbCrLf & "The raw description of the first point is: " & cogoPnt.RawDescription
    
End Sub