How to trap when two notes are merged?

We use notes in drawings for custom purposes. We mark a custom note with a prefix in the note name.

Following the prefix we add characters which uniquely identify the note. We use this id to query our database and set the text for the note. (The note text will automatically change to reflect changes in the database.)

We would like to use the SW note merge feature. To do this, we will need to set the name of the resulting note to include the prefix plus the identifying information from both of the original notes.

We have an Add-In to handle events fired by SW.

Are there any SW events associated with the note merge feature? Ideally, SW would call us after the notes are merged, supplying pointers to both of the original notes, and a pointer to the resulting note. At that time we could set the name and text of the resulting note.

Any suggestions?

Thanks for your help.

SolidworksApi macros
Answers 2
JB
JB 2010-10-15 Best Answer

There's no event for that specifically that I know of.  I'm not sure exactly what happens when notes are merged.  Obviously one of the notes goes away.  You might get lucky and have the DeleteSelectionPreNotify event fire since the note that the user is dropping onto another note is selected.

GA
GA 2010-10-15

We have been using both DrawingDoc_NewSelectionNotify and DrawingDoc_DeleteSelectionPreNotify for other purposes.

DrawingDoc_NewSelectionNotify is fired when the user clicks on the note to drag it.

DrawingDoc_DeleteSelectionPreNotify is not fired when the notes are merged.

At the end of the operation the merged note is selected.

Looks like this will be doable. I can save the information from the note when the user starts to drag it.

Then, I can either trap the DMouseEvents_MouseLBtnUpNotify event, or the DrawingDoc_NewSelectionNotify event (if it is fired on the merged note).

That should give me what I need.

Unless, of course, the merged note is an entirely new note with a new name--which will mean that I won't know which note has been merged with the dragged note.

Worst case, I put a marker in the note text to identify the special info. (That's ugly.)