Message 1 of 5
Detection of changes made in Autocad/Civil 3D with .NET
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I want it to detect and run when I add/remove a point group to Civil3d.
But my code only recognizes the groups it sees at startup (while the form is loading) and detects it while working.
It does not recognize groups added/deleted later.
Can you help me?
Public Class FRM_SampleLineExport
Dim oPG As Autodesk.Civil.DatabaseServices.PointGroup = Nothing
Private Sub frm_Load()
Dim trans As Transaction = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()
Dim civilDoc As CivilDocument = CivilApplication.ActiveDocument
Dim PointGroupIDs As Autodesk.Civil.DatabaseServices.PointGroupCollection
PointGroupIDs = civilDoc.PointGroups
For Each PointGroupID In PointGroupIDs
oPG = PointGroupID.GetObject(OpenMode.ForRead)
If oPG.Id.ToString = "" Then
Exit For
End If
Column7.Items.Add(oPG.Name.ToString)
AddHandler oPG.Modified, AddressOf ChangePGs
Next
End Sub
Public Sub ChangePGs(ByVal senderObj As Object, ByVal evtArgs As EventArgs)
' When a new point group is added to the file
' When group is deleted from file
End Sub
End Class