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

P/Invoke, MDI & CommandFlags.Session

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
439 Views, 0 Replies

P/Invoke, MDI & CommandFlags.Session

I have run into a problem while trying to automate certain tasks in AutoCAD using .NET.  In all of the examples I have seen, and with all of the programming I have done up until this point I have only needed to create functions that operate on the current open drawing, and are executed while the desired drawing is open.

 

Everything is fine with the .NET programming until you need to open and close documents and execute any P/Invoked code on them.  I had a previous post in which I described a specific problem I was having, but I think that in general this is an issue and there should be some sort of explanation or solution.

 

Has anyone worked with creating a CommandFlags.Session command that uses any P/Invoked method on drawings that are opened and closed during the execution of the Session command?

 

The P/Invoked methods will not operate on the mdiactivedocument and it seems that somewhere in the depths there is a document pointer for these methods that point to the drawing that the .NET command was entered in, and once that drawing is closed it then seems to be null.

 

Does anyone know anything about this and what a possible solution might be?

0 REPLIES 0

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