Valued Contributor
Posts: 61
Registered: ‎06-19-2002
Message 1 of 1 (86 Views)

Reference Edit events

86 Views, 0 Replies
06-07-2007 06:37 AM
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
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


Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.