Drawing Document Events

Drawing Document Events

Anonymous
Not applicable
349 Views
2 Replies
Message 1 of 3

Drawing Document Events

Anonymous
Not applicable
Hello,

I'm trying to catch a delete on a drawing file using VB.NET; however, I've run into a number of dead ends. My overall goal is to notice when a note is being deleted from a sheet and remove the Automation dynamic rule that created it.

I began by catching the doc.OnChange; however, that only tells me that there's a delete event in progress. It doesn't give me the information I need to determine which item is being deleted. Next, I attempted to check the activeDocument.SelectSet before the delete event was fired; however, the selectSet was always returning a count of 0. I attempted to do the same thing in VBA and the selectSet had the correct number.

Next, I attempted to use the OnSelect event, but it never caught the select. Then, I tried using the OnMouseUp event, but it never caught the event.

Out of curiosity I switched from a drawing document to an assembly document and the events began firing.

Two questions: Do events work on drawing documents? Do you know of any way to determine information about things being deleted or items selected before a delete event fires?

Thank You,
D. Johnson
0 Likes
350 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Have you tried the DocumentEvents.OnDelete event?
This passes in the object being deleted in the kBefore timing of the
event.

 

Sanjay-
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you, Sanjay.

For some reason I had it in my head that DocumentEvents.OnDelete was fired when a document was being deleted. I'd never even looked at it. haha.

Thanks,
D. Johnson
0 Likes