Hi everybody
I would like to intercept the event when an external reference is modified and saved by using the REFEDIT command.
This is what I have so far
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Interop
Imports System.Runtime.InteropServices
Dim AcadApp As AcadApplication = CType(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, AcadApplication)
Dim WithEvents AcadDoc As AcadDocument = AcadApp.ActiveDocument
Dim WithEvents myRef As Autodesk.AutoCAD.Interop.Common.AcadBlockReference
Private Sub AcadDoc_ObjectModified(ByVal [Object] As Object) Handles AcadDoc.ObjectModified
Try
myRef = CType([Object], Autodesk.AutoCAD.Interop.Common.AcadBlockReference)
Catch ex As Exception
'here there are exceptions when selecting other types of objects but AcadBlockReference
End Try
End Sub
Private Sub myRef_Modified(ByVal pObject As Autodesk.AutoCAD.Interop.Common.AcadObject) Handles myRef.Modified
'here what my code goes
End Sub
I beleive there is a more efficent way to achive it.
I will appreciate any help
Regards
Raul