If there is a better way of going about this I would be happy to hear it, but for now this is the only course of action I have figured out.
I am importing a dgn into autocad by using the SendStringToExecute method with the 'Import' command. My problem is that once I have the dgn imported I want to do some modification and then save the drawing, but setting a new dim to the current mdiactivedocument still gives me the initial document and not the one opened by the import command as I had thought it would.
How can I switch the mdiactivedocument over to the newly opened document?
Thanks,
Jason
If you're doing that from the handler of a registered command, the CommandMethod attribute needs to have the CommandFlags.Session flag set. That allows the command to run in the application context.
If a command doesn't run in the application context, it's execution is suspended when the document that it was issued in is deactivated, and will not resume until the document is activated again.
When you define a command with CommandFlags.Session, you also must lock/unlock any document you work with.