.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reference Edit events

0 REPLIES 0
Reply
Message 1 of 1
rtejada
232 Views, 0 Replies

Reference Edit events

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
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost