.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Topmost Drawing Not Active for SendStringToExecute

1 REPLY 1
Reply
Message 1 of 2
JasonSelf
387 Views, 1 Reply

Topmost Drawing Not Active for SendStringToExecute

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

1 REPLY 1
Message 2 of 2

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost