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.
Creating a command
- [Speaker] Now that we understand what an I external command is. Let's use this class to create a command in our project file. I'm continuing on where we left off in video four of this section. If you don't have it opened, you can find it in the exercise folder for this video. The command that we'll be creating will allow us to select an element and retrieve its element ID. So let's start by renaming the class we made in the previous video so that it would describe the command that it's going to perform. In the solution explorer on the right, we can rename the class by right clicking the object and clicking rename. I'm going to call mine, get element ID. And hit enter. And then as we want to update all references to class one, I'm going to click yes. Great, so let's start by implementing the I external command interface. To do that, we simply add a colon after our class name and then the interface which is I external command. You can see that it's popped up in the IntelliSense. This…
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
-
-
-
-
-
-