Application: CurvedBeam
Revit Platform: All
Revit Version: 2011.0
First Released For: 2008.0
Programming Language: C#
Skill Level: Beginning
Category: Structure
Type: ExternalCommand

Subject: Curved Beam creation.
Summary: 
This sample demonstrates how to create curved beam, this sample can create three types of curved beam: arc, ellipse and nurbspline.

Classes: 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.Creation.Document
Autodesk.Revit.DB.Symbols.FamilySymbol
Autodesk.Revit.DB.FamilyInstance
Autodesk.Revit.DB.Level
Autodesk.Revit.DB.Geometry.Arc
Autodesk.Revit.DB.Geometry.Ellipse
Autodesk.Revit.DB.Geometry.NurbSpline
Autodesk.Revit.DB.Geometry.XYZ

Project Files: 
CurvedBeam.cs
This file contains the class Command which inherits from IExternalCommand interface and implements the Execute method; besides, it implements the functionalities to get all levels and structural framing (beam and brace) types from Revit project. Two classes SymbolMap and LevelMap which are for reserving all types of beam and level are contained in this file too.

CurvedBeamForm.cs
This file contains a Form class which consists of two ComboBox controls which will show all structural framing (beam and brace) types and levels of project; three buttons which will create arc, ellipse, nurbspline beams respectively when they’re clicked.

Description: 
This sample uses FamilySymbol, FamilyInstance, Arc, Ellipse and NurbSpline classes mostly to get all structural framing types and levels from Revit project, then use them to create new beam.
-	To get structural framing types and levels of Revit, use ElementClassFilter to iterate them.
-	To get all symbols of a family, use Family.Symbols property.
-	To get the category of family symbol, use FamiySybol.Category property.
-	To create arc, ellipse and nurbspline, use NewArc, NewEllipse and NewNurbSpline methods of Creation.Document class respectively.
-	To create curved beam instance, use NewFamilyInstance method of Creation.Document class, by specifying the curve for new beam.

Instructions: 
1.	Start Revit, make sure there are some structural framing types and levels in project.
2.	Run the command, the “Curved Beam” form will pop up, all the available framing types and levels will be listed in two ComboBox controls.
3.	Select a type and a level on which beam will be created
4.	Click “Arc” button will create one arc beam, click “Partial Ellipse” button will create one partial ellipse beam, click “Spline” button will create one nurbspline beam.

Note:
1.	The location of arc, ellipse and nurbspline instances are hard codes.
2.	Please run the sample in latest version (later than 14th, Dec, 2006).