From the course: Revit: Creating C# Plugins

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Traversing geometry

Traversing geometry

From the course: Revit: Creating C# Plugins

Start my 1-month free trial

Traversing geometry

- [Instructor] Now that we know how to retrieve geometry from an element, let's try to extract the faces of a wall and calculate its total area. I've currently got the Visual Studio exercise file open for this video. In here I've created the class SelectGeometry which is a new IExternalCommand. This command allows us to select an object and then retrieves an element. So, inside of this if statement, let's extract the faces of a wall and then calculate its total area and number of faces. To start, let's create the options object that we can use to specify how the geometry is output. So, let's create an options variable named gOptions and we'll assign to this a new options object using the constructor with no parameters. Great. Now let's hit the detail level of the options by accessing the detail level property from the options object and setting it to a new ViewDetailLevel enum of Fine. This means the geometry will be as detailed as possible. With this option object, we can now…

Contents