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.
Modifying elements
- [Narrator] We now have a command in our project file that has started a transaction. Let's use this to modify the document by learning how to delete an element. To start, in the object browser, let's search for delete. Perfect, so it looks like the first method is the delete method from the document class. If you can't see this, make sure the settings of the browser includes show inherited members. This method simply takes an element ID, which is the element to be deleted. So let's use this in our command. And we'll do this after the transaction has started. To access the delete method let's access the document, and here we can find delete. Then for the element ID, we can retrieve this from the selected element as we have done in previous videos. By accessing the element ID property from the picked object. Perfect. So the element will delete, but not until the transaction has been committed. To ensure the user is confident they want to delete the method, let's create a task dialogue…
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
-
Retrieving element information6m 39s
-
FilteredElementCollector3m 7s
-
Creating a collector7m 28s
-
Transactions2m 47s
-
Modifying elements5m 30s
-
Creating families7m 54s
-
Querying FilteredElementCollector5m 7s
-
Creating line-based elements6m 55s
-
Creating loop elements5m 59s
-
Get parameter6m 3s
-
Parameter values4m 45s
-
-
-
-
-