Application: FrameBuilder
Revit Platform: All
Revit Version: 2011.0
First Released For: 9.1
Programming Language: C#
Skill Level: Medium
Category: Structure
Type: ExternalCommand

Subject: Create a frame composed of columns, beams and braces.
Summary: 
This sample demonstrates how to create a frame composed of columns, beams and braces. User can input parameters to create a frame consist of column, beam and brace. It has a user visible option to use the suspended updating function to increase the speed of the model creation. And users can duplicate the type of column, beam and brace.

Classes: 
Autodesk.Revit.UI.IExternalCommand 
Autodesk.Revit.DB.FamilyInstance
Autodesk.Revit.DB.Document 
Autodesk.Revit.DB.Level
Autodesk.Revit.DB.FamilySymbol

Project Files: 
Command.cs
The main DLL source file which contains the class Command which implements interface IExternalCommand. Initialize necessary data to create framing and display UI for user's input

CreateFrameForm.cs
This file contains a class that is the main form to create framing.

DuplicateTypeForm.cs
This file contains a class that is the form to duplicate FamilySymbol and edit its name and parameters

ErrorMessageException.cs
This file contains a class which passes error message to UI or back to internal error messagebox by Execute method in IExternalCommand.

FrameBuilder.cs
This file contains a class which creates columns, beams and braces to create framing

FrameData.cs
This file contains a data class which includes information to create framing

FrameTypeParameters.cs
This file contains a class which is used to show and modify parameters of column, beam or brace for control PropertyGrid

FrameTypesMgr.cs
This file contains a class which is the data manager taking charge of FamilySymbol object in current document
-	Press the Duplicate button in the dialog;

Description: 
This sample provides the following functionality:
-	Present a dialog to users asking for the following 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
-	Incremental height of Auto-generated levels
-	Coordinate of the bottom left corner of Frame
-	Angle to rotate Frame in clockwise
-	The number of floors is less than the number of levels since columns will be inserted from the level below to the level above. For example if the number of floors requested is 3 then there must be 4 levels and the columns will go from Level 1 to 2, Level 2 to 3 and Level 3 to 4. If there is less than 2 levels tell the user 2 levels must be added and exit the command with a failure. If more levels are need, auto-generate levels according to the number of floors. The height between adjoin generated levels equals to the height between the highest 2 levels existed in the project.
-	Starting with the lowest level and progressing to higher levels, insert columns with the specified type into the project programmatically in an array format based on the number of columns specified in the X and Y directions with the correct specified distance between them. Do this for each floor specified.
-	Insert beams of the specified type between the tops of each adjacent column in the X and Y direction to form a square grid of beams. Beams are not needed between diagonal columns.
-	Insert braces of the specified type between the midpoint of each column and the midpoint of each adjoining beam.
-	The frame is moved according to the coordinate of the bottom left corner. Then rotate it in clockwise according to the input angle.
-	Users can create a new concrete element type through duplicating specified type. The work flow is as follows:
-	Press the Duplicate button in the dialog;
-	Change name of column’s type and press OK;
-	Change value for b and h of section in another dialog and press OK;
-	Similar steps can be followed for concrete and wood beams and braces.

Instructions: 
1.	Open Revit Structure.
2.	Run the command.
3.	Input the information to create beams, brace and columns, input the angle to rotate (optional).
4.	In sample’s main UI click the OK button.
5.	Application will create a frame consist of column, beam and brace.