Acad.Invoke

object acadDoc = doc.AcadDocument; // replace with doc.Getacaddocument() for A2013+
            object selSet = acadDoc.Get("ActiveSelectionSet");
            acadDoc.Invoke(
                "Export",
                System.IO.Path.ChangeExtension(db.Filename, "wmf"),
                "wmf",
                selSet);
            selSet.Invoke("Delete");


  public static void Save( this Document doc )
  {
    object acadDoc = doc.AcadDocument;            // change to .GetAcadDocument() for 2013
    acadDoc.GetType().InvokeMember( "Save", 
             BindingFlags.InvokeMethod, null, acadDoc, new object[0]);
  }





Please follow WeChat's public account ByCAD