Instantiates a transaction object
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.1.0.0 (26.1.0.34)
Syntax
C#
public Transaction( Document document, string name )
Parameters
- document Document
- The document for which this transaction is going to be used.
- name String
- The name of the transaction. This name will appear in the undo menu once the transaction is successfully committed. The name must not be empty. The name can be reset later by either calling SetName(String) or by using the name argument in the Start(String) method.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The name argument is an empty string. -or- Document is a linked file. Transactions can only be used in primary documents (projects or families.) |
ArgumentNullException | A non-optional argument was null |