I want Delete Maskined Region from Revit Document using C#. Error : Modifying is forbidden because the document has no open transaction. Exception: ModificationOutsideTransactionException
Asked
Active
Viewed 79 times
1 Answers
1
You have 2 options:
change the TransactionMode to Automatic at the class attribute
[Transaction(TransactionMode.Automatic)]
open a transaction within your command
Transaction tr = new Transaction(commandData.Application.ActiveUIDocument.Document);
tr.Start("Command name here");
// your code
tr.Commit();
Also posted here.

Community
- 1
- 1

Augusto Goncalves
- 8,493
- 2
- 17
- 44