Transaction |

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

The TransactionGroup type exposes the following members.

Name | Description | |
---|---|---|
![]() | TransactionGroup(Document) | Constructs a transaction group object. |
![]() | TransactionGroup(Document, String) | It constructs a transaction group object |

Name | Description | |
---|---|---|
![]() | IsFailureHandlingForcedModal | Forces all transactions finished inside this group to use modal failure handling regardless of what failure handling options are set for those transactions. |
![]() | IsValidObject | Specifies whether the .NET object represents a valid Revit entity. |

Name | Description | |
---|---|---|
![]() ![]() | Assimilate | Assimilates all inner transactions by merging them into a single undo item. |
![]() ![]() | Commit | Commits the transaction group. |
![]() | Dispose | Releases all resources used by the TransactionGroup |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object ) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object ) |
![]() | GetName | Returns the transaction group's name. It could be an empty string. |
![]() | GetStatus | Gets the current status of the transaction group. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object ) |
![]() | HasEnded | Determines whether the transaction group has ended already. |
![]() | HasStarted | Determines whether the transaction has been started yet. |
![]() | RollBack | Rolls back the transaction group, which effectively undoes all transactions committed inside the group. |
![]() | SetName | Sets the transaction group's name. |
![]() | Start | Starts the transaction group |
![]() | Start(String) | Starts the transaction group with an assigned name. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object ) |

A transaction group controls whether transactions committed inside the group should stay committed or should be all discarded. If the group is committed, all the transactions remain committed, but if the transaction group is rolled back instead, all the inner, already committed transactions will be undone (and removed).
There are two ways of committing a group - Commit and Assimilate. By committing, all transactions committed inside a group stay as they are, while by assimilating, all inner transactions will be merged into a single transaction.
A transaction group can only be started when no transaction is active, and must be closed only after the last transaction started inside the group is finished, i.e. after it was either committed or rolled back.
Transaction groups may be nested inside each other with the restriction that every nested transaction group is entirely contained (opened and closed) in the parent transaction group.
If a transaction group was started and not finished yet by the time the TransactionGroup object is about to be, the default destructor will roll it back automatically, thus all changes made to the document while this transaction group was open will be discarded. It is not recommended to rely on this default behavior though. Instead, it is advised to always call either Commit , RollBack , or Assimilate explicitly before the group object gets destroyed. Please note that unless invoked explicitly the actual destruction of an object in managed code might not happen until the object is collected by the garbage collector.
