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.
Selecting elements
- [Narrator] Many commands in Revit start with a prompt to the user to select a single element, multiple elements, or part of a particular element such as its face. The OI document allows us to access user interface functionality including the ability to select elements in the project. So, now that we have the UI document in our command let's use that to select an element from the project. In the command we have created, let's use the UI document to retrieve a selected element from the Revit document. To do that we need to use a method called pickObject from the selection class that can be retrieved from the UI document object. This will return a reference element from the Revit API. A reference element from the Revit API is simply a stable reference to a geometric object in Revit. So, let's create a reference variable named PickObj and we'll do this after we've retrieved the UI document. We can then assign to this the result of the pickObject method. To access this, let's access the…
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
-
-
-
The Revit API2m 18s
-
(Locked)
Viewing the Revit API3m 33s
-
(Locked)
Setting up Visual Studio4m 34s
-
(Locked)
Adding the API4m 48s
-
(Locked)
The IExternalCommand3m 10s
-
(Locked)
Creating a command4m 16s
-
(Locked)
Accessing the application2m 48s
-
(Locked)
Selecting elements4m 58s
-
(Locked)
Registering add-ins5m 38s
-
(Locked)
Compiling the code5m 17s
-
(Locked)
Debugging4m 49s
-
-
-
-
-
-