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

closing the default 'Drawing1'

1 REPLY 1
Reply
Message 1 of 2
OsamaElewa
375 Views, 1 Reply

closing the default 'Drawing1'

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 

1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: OsamaElewa

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

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

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