Application: BRepBuilderExample
Revit Platform: All
Revit Version: 2018.0
First Released For: 2017.0
Programming Language: C#
Skill Level: Medium
Category: Geometry
Type: ExternalApplication

Subject: BRepBuilder usage example

Summary: 
Several cases of BRepBuilder usage for constructing Revit geometry using API.

Classes: 
Autodesk.Revit.UI.IExternalApplication 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.BRepBuilder
Autodesk.Revit.DB.DirectShape

Project Files: 
Application.cs
It contains the class Application which inherits from interface IExternalApplication and implements OnStartup and OnShutdown methods.
CreateCube.cs
It contains the class CreateCube which inherits from interface IExternalCommand and implements the Execute method.
CreateNURBS.cs
It contains the class CreateNURBS which inherits from interface IExternalCommand and implements the Execute method.
CreatePeriodic.cs
It contains the class CreatePeriodic which inherits from interface IExternalCommand and implements the Execute method.

Description: 
This sample provides the following functionalities:

-	Let user create simple cubical solid using BRepBuilder.

-	Let user create Nurbs surface (open shell) using BRepBuilder.

-	Let user create two solids (truncated cone and cylinder) with periodic face surfaces using BRepBuilder.

Geometry created by BRepBuilder then set in DirectShape element to make it visible in Revit views. 

Instructions: 
Open Revit application. Open empty architectural template.and create 3D View.
Notice the extra Ribbon Pannel named “Create Geometry”. It has three buttons:
1.	“CreateCube”. Press it to create simple cubical solid using BRepBuilder.

2.	“CreateNURBS”. Press it to create Nurbs surface (open shell) using BRepBuilder.

3.	“CreatePeriodic”. Press it to create two solids (cone and cylinder) with periodic face surfaces using BRepBuilder.