Is it possible to close the active document while a managed .NET command (defined with the CommandMethod attribute) is still running?
Background:
Part of my application's workflow is to "close" the currently active drawing, while opening a new one based on our template (this is prior to our automatic entity generation from an input file).
If the drawing is currently open, it needs to be closed or the program can not save the new document. This behaviour will work only if the user did not have the target document open as the active document.
I tried once to apply the CommandFlags.Session flag to my entry point, but the drawing would not close because it still had a command running.
Currently if this is the case I am taking the active document's database and deleting all modelspace/paperspace entities and block definitions. I obviously don't want this to be my solution.
Any help would be appreciated.
JB