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

Reference Edit events

87 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


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.