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

Drawing is busy while SaveAndClose acDoc.

1 REPLY 1
Reply
Message 1 of 2
xpeter88
622 Views, 1 Reply

Drawing is busy while SaveAndClose acDoc.

Hi,
I am working on one macro that read drawing names from excel, opens it, do some modification. After that I would need to save and close active drawing. When I use expression acDoc.SaveAndClose(acDoc.Name)
I am getting g an error - drawing is busy. I can save the drawing use save as method without any problems but can save and close it. Do you know what could be an issue? Probably I have to release that drawing or make it active somehow.

Any help is welcome.

Many thanks,
Peter
1 REPLY 1
Message 2 of 2
Hallex
in reply to: xpeter88

Methink you have to use P/Invoke
[DllImport ("user32.dll")]
static extern IntPtr SetFocus (IntPtr hWnd);
// Then in the code after save as:
SetFocus (Application.DocumentManager.MdiActiveDocument.Window Handle);
Application.DocumentManager.MdiActiveDocument.CloseAndDiscard();
// not tested, just an idea
_____________________________________
C6309D9E0751D165D0934D0621DFF27919

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