RVTDocs.com
Namespace: Autodesk.Revit.DB Class: SubTransaction

Commit

Method
Description:
Commits all changes made to the model made during the sub-transaction.
Remarks:

The changes are not permanently committed to the document yet. They will be committed only when the active transaction is committed. If the transaction is rolled back instead, the changes committed during this sub-transaction will be discarded.

Commit can be called only when all inner sub-transactions, if any, are already finished, i.e. they were either committed or rolled back. If there is still a sub-transaction open, an attempt to commit this outer sub-transaction will cause an exception.

Syntax
public TransactionStatus Commit()
Exceptions
Exception Condition
Autodesk.Revit.Exceptions.InvalidOperationException A sub-transaction can only be active inside an open Transaction. -or- The sub-transaction's current status is not TransactionStatus.Started, therefore it may not be committed or rolled back.