This is sort of a strange scenario. I have a .NET app that calls some ancient LISP routines to insert blocks into a users AutoCAD drawing. So far, so good. However, if the user happens to be in the middle of another command, a com exception (call rejected.....)would be thrown. This was easy enough to solve using the SendKeys function to send escape chars to AutoCAD prior to entering the block insertioon code. I've also seen other resolutions to the same issue on this forum.
My question is this. If a user goes to insert a block using my .NET app, and then, while they are placing the block, happen to do a transparent zoom or pan, the same com exception is thrown. Now, I can catch the exception, but when I do that my app comes to the foreground. If I click bach over to AutoCAD, my block is sitting on the users cursor waiting to be inserted.
Does anybody know a more effective way of handling the "Call Rejected..." exceptions that may occur due to the users use of of transparent AutoCAD commands while our code is executing.