Thanks Tony, it works a treat.
Odd that when substituting
MessageBox.Show(msg); for
Acad.DocumentManager.MdiActiveDocument.Editor.WriteMessage( msg );
You get a new instance of cad every time
I'm not all that suprised, because when you show a modal
dialog or message box, that causes the AutoCAD window to
be deactivated, and activated again when the modal dialog
or message box is dismissed.
In other words, what you are doing in the handler of the
event, is causing the event to fire again, and again, and
again....