Answers for "combine transaction revit api"

0

combine transaction revit api

using (TransactionGroup transGroup = new TransactionGroup(document))
{
   using (Transaction trans = new Transaction(document))
   {
      try
      {
         transGroup.Start("Action");

         trans.Start("First Transaction");
 
         // do some stuff
 
         if (trans.Commit() != TransactionStatus.Committed)
         {
            return Result.Failed;
         }

         trans.Start("Second Transaction");
 
         // do some more stuff
 
         trans.Commit();
 
         if (trans.Commit() != TransactionStatus.Committed)
         {
            return Result.Failed;
         }

         transGroup.Assimilate();
      }
      catch
      {
         return Result.Failed;
      }
   }
   return Result.Succeeded;
}
Posted by: Guest on July-02-2021

Code answers related to "combine transaction revit api"

Browse Popular Code Answers by Language