Hi all. Maybe someone across this problem.
I do rollback transactionGroup after commiting some transactions in this group. But it isn't works in local file which was done from central model. It successfully works in usual local file. Can anyone help me?
using (TransactionGroup transactionGroup = new TransactionGroup(Doc, "TransGroup")) { transactionGroup.Start("Numerating Sheets"); Transaction transaction = new Transaction(Doc, "Transaction"); foreach (var sheet in sheets) { if (_flag) { transactionGroup.RollBack(); break; } transaction.Start("Numbering Sheet"); ViewSheet viewSheet = Doc.GetElement(sheet.ElementId) as ViewSheet; viewSheet.SheetNumber = sheet.Number; MainWindow.ProgressBar.Dispatcher.Invoke(new ProgressBarDelegate(UpdateProgress), DispatcherPriority.Background); transaction.Commit(); } if (!_flag) transactionGroup.Assimilate();
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Hi @Anonymous ,
These links will help you to solve your issue
https://thebuildingcoder.typepad.com/blog/2013/12/saving-a-new-central-file-to-revit-server.html
https://thebuildingcoder.typepad.com/blog/2013/12/saving-a-new-central-file-to-revit-server.html#4
Thank you for reporting, but in that article Jeremy said about naming of transactions. In my case, i just can't rollback group of transactions. TransactionStatus is RolledBack, but changes still accepted.
All you are doing in each individual transaction is renumbering a sheet.
Why waste an entire transaction for that task?
Why not do all the renumbering of all sheets in one single transaction?
What possible causes can you have to want to roll back the modification?
From this minimal snippet of your, it looks to me as if you could simplify your process.
Thank you for answer! I did renumbering in single transaction as you say. My sollution was really hard 🙂
I want to user can abort numbering and don't wait for ending of operation.
Can't find what you're looking for? Ask the community or share your knowledge.