save all open drawings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I tried the following method to save all drawing currently open. It always fire fill access arror, whereas AutoCAD can save the file wihthout any issue. Here I am checking for drawings that not even saved once and ask the user to take action for those files.
try
{
DocumentCollection docs = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;
foreach (Document doc in docs)
{
string dname = doc.Name;
string s = doc.Name.Substring(doc.Name.LastIndexOf('\\') + 1);
if (s != doc.Name) //checking for additional path
{
doc.Database.SaveAs(dname, true, DwgVersion.Current,doc.Database.SecurityParameters);
}
else
{
System.Windows.Forms.MessageBox.Show("Please save " + doc.Name + " manualy!!!!");
}
}
}
catch (System.Exception ee)
{
System.Windows.Forms.MessageBox.Show("Exception: " + ee.Message);
}
Regards,
Shijith