From the course: Revit: Creating C# Plugins
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Transactions
- So far in the course we have used the Revit API to access elements and data from the Revit model although we haven't made any actual changes to the model. To do this we will need to learn about Revit transactions. Any changes that are made to the Revit model need to be encapsulated inside of an active transaction otherwise an exception will be thrown. We can create a transaction by using the transaction class. The transaction class, once instantiated, offers a few different methods to control a transaction. These are Start, Commit and Rollback. Start allows us to start a transaction, Commit commits any changes to the model and Rollback reverts any changes to before the transaction. Once an active transaction is committed the changes made inside the transaction become part of the model. It is important to note here that only one transaction can be active at one time. It is also important to enclose a transaction within a using or try-catch statement to ensure the transaction does not…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Classifying elements5m 22s
-
(Locked)
Retrieving element information6m 39s
-
(Locked)
FilteredElementCollector3m 7s
-
(Locked)
Creating a collector7m 28s
-
(Locked)
Transactions2m 47s
-
(Locked)
Modifying elements5m 30s
-
(Locked)
Creating families7m 54s
-
(Locked)
Querying FilteredElementCollector5m 7s
-
(Locked)
Creating line-based elements6m 55s
-
(Locked)
Creating loop elements5m 59s
-
(Locked)
Get parameter6m 3s
-
(Locked)
Parameter values4m 45s
-
-
-
-
-