Transaction Constructor (Document)


Instantiates a transaction object.

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

Syntax

C#
public Transaction(
	Document document
)
Visual Basic
Public Sub New ( _
	document As Document _
)
Visual C++
public:
Transaction(
	Document^ document
)

Parameters

document
Type: Autodesk.Revit.DBDocument
The document for which this transaction is going to be used.

Remarks

The transaction does not start by creating a transaction object. One of the 'Start' methods will need to be called in order to start this transaction.

A transaction cannot start unless is has a valid (non-empty) name. Because this constructor does not take a name, a name must be assigned later before or during the 'Start' method.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException Document is a linked file. Transactions can only be used in primary documents (projects or families.)
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →