Application: CreateBeamsColumnsBraces
Revit Platform: All
Revit Version: 2009.0
First Released For: 9.0
Last Modified: 02/26/2008
Modified By: JY Autodesk
Programming Language: VB.NET
Skill Level: Medium
Category: Create
Type: ExternalCommand

Subject: Create a frame with beams, columns and braces.
Summary: 
This sample demonstrates how to create a truss model which composes of columns, beams and braces automatically according to the user’s input.

Classes: 
Autodesk.Revit.IExternalCommand 
Autodesk.Revit.Symbols.FamilySymbol

Project Files: 
CreateBeamsColumnsBraces.vb
This is the main DLL source file. It contains the class Command which implements the interface IExternalCommand. Command class also collects all the symbols of levels, columns, beams & braces in current document and takes charge of creating a truss model.

CreateBeamsColumnsBracesForm.vb
This file contains the CreateBeamsColumnsBracesForm class which is the sample’s UI to collect user’s input.

Description: 
-	Presents a dialog to ask the user for the following information, and create truss model according to these information.
-	Distance between columns
-	Number of Columns in the X direction
-	Number of Columns in the Y direction
-	The type of the columns
-	The type of the beams
-	The type of the braces
-	Number of Floors
-	The code should verify whether the number of floors is less than the number of levels since columns will be inserted from the level below to the level above. If there are not enough levels, notify the user the number of levels that must be added and exit the command with a failure message.
-	Levels can be retrieved by iterating through the document elements. 
-	The types that can be used for the beams, columns and braces can be located by searching the database for FamilySymbol objects that have material type of something other than undefined.
-	All inserted beams, columns and braces must be specified as structural during creation.
-	To insert a beam use the NewFamilyInstance method that takes a location and a reference direction. Location point should be the start of the beam and the reference direction should be a vector along the direction of the beam. Specify the structural type as beam.
-	To insert a brace do the same as for a beam but specify brace as the structural type.
	
Instructions: 
1.	No context to execute this sample, please directly run this command.
2.	User can input or select valid values in the sample UI (certainly, we can use the default values).
3.	Then click OK button.
4.	Expected result: return to Revit main program after run this sample, a Columns Beams and Braces truss model will present.