How to open a drawing without saving previous drawing

How to open a drawing without saving previous drawing

Anonymous
Not applicable
427 Views
2 Replies
Message 1 of 3

How to open a drawing without saving previous drawing

Anonymous
Not applicable

I need to process large amounts of drawings without saving the drawings as I go.  I have read online about a method called closeanddiscard() but it does not exist.  

 

Thanks very much!

0 Likes
428 Views
2 Replies
Replies (2)
Message 2 of 3

Keith.Brown
Advisor
Advisor

Did you try closing the database without saving it?

0 Likes
Message 3 of 3

SENL1362
Advisor
Advisor
[CommandMethod("SaveCloseDrawing")]
public static void SaveCloseDrawing()
{
Document doc = AcadApp.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;

try
{
object acadDoc = (AcadDocument)doc.GetAcadDocument(); // or (AcadDocument)doc.AcadDocument;
acadDoc.GetType().InvokeMember("Save", System.Reflection.BindingFlags.InvokeMethod, null, acadDoc, null);
acadDoc = null;
doc.CloseAndDiscard();
}
catch (System.Exception ex)
{
ed.WriteMessage(ex.Message);
}
}
0 Likes