.NET

Reply
Member
cisolutions
Posts: 5
Registered: ‎01-27-2014
Message 1 of 2 (125 Views)

closing the default 'Drawing1'

125 Views, 1 Replies
01-29-2014 01:20 AM

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 

ADN Support Specialist
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 2 of 2 (62 Views)

Re: closing the default 'Drawing1'

02-11-2014 09:55 PM in reply to: cisolutions

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.