I open a document using:
Document acDoc = acDocMgr.Open(DrawingPath, false);
My code runs and updates the drawing, then I look in the title bar and it says the drawing is read only and if I try save it says it is write protected.
So I am opening the drawing to write, I am telling it that openreadonly = false, yet when I am done it is read only.
I have using statements for the document lock and the transaction, so when they are done the drawing should be released back to a state where surely you can save the file.
I am using a function with the following setup:
public static class MyCommands
{
[CommandMethod("Draw", CommandFlags.Session)]
public static void Draw()
{
Since I want to iterate over drawings and add/change them I have it set up this way.
Does anyone know what might cause this? Is there something you need to release somewhere. I try doc.upgradeopen and it either does not have any effect or it crashes autocad saying eWasOpenForWrite.
But no matter what happens at the end of running a bit of code it wont let me save my changes. What A useless API, dont tell me the file is write protected - TELL ME WHY
What about docmanager.ExecuteInApplicationContext()? Do I need a whole different approach?