Application: CreateTruss
Revit Platform: Structure
Revit Version: 2011.0
First Released For: 2010.0
Programming Language: C#
Skill Level: Medium
Category: Families
Type: ExternalCommand

Subject: Create Truss
Summary: 
This sample demonstrates how to create a mono truss in truss family document.

Classes: 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.Document
Autodesk.Revit.DB.ModelCurve
Autodesk.Revit.DB.Family
Autodesk.Revit.Creation.ItemFactoryBase
Autodesk.Revit.Creation.FamilyItemFactory

Project Files: 
Command.cs
      This file contains the class Command that inherits from IExternalCommand. The class implements the Execute method and be used to create a mono truss in truss family document.

Description: 
The sample utilizes the method NewModelCurve to create the truss curves and utilizes the TrussCurveType property of ModelCurve class to set their truss types.
Some useful constraints are added to the truss curves by the method NewAlignment.

Instructions: 
This external command can be run on Revit family document.
1.	Update your Revit.ini by following lines: 
[ExternalCommands]
ECCount        = 1
ECName1        = Create Truss
ECClassName1   = Revit.SDK.Samples.CreateTruss.CS.Command
ECAssembly1    = <your path>\CreateTruss.dll
ECDescription1 = Create truss in truss family document.
2.	Start Revit.
3.	In order to use the sample, the user should manually create a family document with structural trusses template. If the template is not right, the command will fail.
4.	Run this external command and a mono truss is created in truss family document.