Hi guys,
kindly I am using method to close the current file after plotting it, it works but it closes also the default file opend with Autocad which named 'Drawing1', another thing if there is any other drawing opend in Autocad it does not close it, I am wondering why?
public void SaveAndClose(bool _boolSave) { AcadApplication app3 = (AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication; if (_boolSave == true) { app3.ActiveDocument.Save(); app3.ActiveDocument.Close(); } else { app3.ActiveDocument.Close(); } }//end of saving and closing method
thanks alot
Hi,
This behavior is as-designed and can also be reproduced using the AutoCAD UI with no custom code involved.
AutoCAD can remain in one of the two states : zero-doc or with some document(s) open
"Drawing1.dwg" is not treated as a document that was saved and AutoCAD closes it when moving to a zero-doc state.
With two documents open, if any one of the document is closed, AutoCAD does not move to the zero-doc state and hence there is no need for it to close "Drawing1.dwg". If you close the other document now, then "Drawing1.dwg" will also be closed for AutoCAD to reach the zero-doc state.
Hope this explains.
Regards,
Balaji