Exemplo n.º 1
0
 public static void PurgeDb(Database db, Transaction tr, bool clearDGN = false)
 {
     try
     {
         ObjectIdCollection objectIdCollection = new ObjectIdCollection();
         objectIdCollection.Add(db.LayerTableId);
         objectIdCollection.Add(db.LinetypeTableId);
         objectIdCollection.Add(db.TextStyleTableId);
         objectIdCollection.Add(db.BlockTableId);
         objectIdCollection.Add(db.DimStyleTableId);
         if (tr == null)
         {
             Transaction transaction = db.TransactionManager.StartTransaction();
             tr = transaction;
             using (transaction)
             {
                 if (clearDGN)
                 {
                     SBGJ.PurgeDGN(db, tr);
                 }
                 SBGJ.PurgeItems(db, tr, objectIdCollection);
                 goto IL_97;
             }
         }
         if (clearDGN)
         {
             SBGJ.PurgeDGN(db, tr);
         }
         SBGJ.PurgeItems(db, tr, objectIdCollection);
         IL_97:;
     }
     catch (Exception ex)
     {
     }
 }