Application: RotateFramingObjects
Revit product and version: Revit Architecture 2008, Revit Structure 2008
Last Modified: 11/12/2006
Modified By: AL Autodesk HSL
Programming Language: C#

Subject:  Demonstrates how to rotate beams, braces or structural columns around their directional axis rather than project axis.

Classes: 
Autodesk.Revit.Element 
Autodesk.Revit.Parameter
Autodesk.Revit.Elements.FamilyInstance
Autodesk.Revit.Structural.Enums.StructuralType
Autodesk.Revit.Creation.Application

Project Files: 
RotateFramingObjects.cs
This file contains the class RotateFramingObjects that inherits from IExternalCommand. Its function is to rotate the selected instances.

RotateFramingObjectsForm.cs
This file contains the Form class that can get the angle that the instances will be rotated by or to determined by checking “Relative” or “Absolute”. And if only one instance is selected, the angle input text box will show its current angle, otherwise be blank.

Description: 
-	To rotate an instance of beam or brace, use Parameter.Set(double angle), the parameter should be in the collection of parameters of the beam or brace and its definition name is “Angle”.
-	To rotate an instance of column, use FamilyInstance.Location.Rotate(Line axis, double angle). the axis of column can be determined by its location and a vertical vector.
-	To create a new line, use Autodesk.Revit.Creation.Application.NewLineUnbound(ref XYZ point, ref XYZ direction)

Instructions: 
1.	Select some elements which should be beam, brace or column.
2.	Select radio buttons to decide we take either “relative” or “absolute” rotation.
3.	Input the value of angle that instances are rotated by/to.
4.	Click OK button to rotate the instances.