Revit 2026 API
Transaction |
Commits the transaction group.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntax
public TransactionStatus Commit()
Public Function Commit As TransactionStatus
public: TransactionStatus Commit()
member Commit : unit -> TransactionStatus
Return Value
TransactionStatusIf finished successfully, this method returns TransactionStatus.Committed.
| Exception | Condition |
|---|---|
| InvalidOperationException | The Transaction group has not been started (its status is not 'Started').. -or- The transaction's document is currently in failure mode. Transaction groups cannot be closed until failure handling is finished. You may use a transaction finalizer to close a group after the failure handling ends. |
Committing a group does not change the model. It only confirms the commitment of all inner groups and transactions.
Commit can be called only when all inner transaction groups and transactions are finished, i.e. after they were either committed or rolled back. If there is still a transaction or an inner transaction group open, an attempt to commit this outer group will cause an exception.
See Also