Application: CreateDimensions
Revit Platform: Structure
Revit Version: 2009.0
First Released For: 9.0
Last Modified: 02/26/2008
Modified By: LL Autodesk
Programming Language: C#
Skill Level: Medium
Category: Create
Type: ExternalCommand

Subject: Create dimensions.
Summary: 
This sample shows how to add a dimension to a selected structure wall from its start to its end.

Classes: 
Autodesk.Revit.IExternalCommand
Autodesk.Revit.Elements.View
Autodesk.Revit.Elements.Wall
Autodesk.Revit.Elements.Dimension
Autodesk.Revit.CategorySet
Autodesk.Revit.Category
Autodesk.Revit.SelElementSet 
Autodesk.Revit.Location
Autodesk.Revit.LocationCurve
Autodesk.Revit.Geometry.Curve
Autodesk.Revit.Geometry.Line
Autodesk.Revit.Geometry.ReferenceArray
Autodesk.Revit.Geometry.Options
Autodesk.Revit.Geometry.Element
Autodesk.Revit.Geometry.GeometryObjectArray
Autodesk.Revit.Geometry.GeometryObject
Autodesk.Revit.ParameterSet
Autodesk.Revit.Parameter
Autodesk.Revit.Parameters.DefinitionFile
Autodesk.Revit.Parameters.DefinitionGroups
Autodesk.Revit.Parameters.DefinitionGroup
Autodesk.Revit.Parameters.Definition
Autodesk.Revit.Parameters.InstanceBinding

Project Files: 
Command.vb
It contains the class Command which implements interface IExternalCommand. It also provides the function of adding a dimension to a selected wall from its start point to its end point.

Description: 
This sample provides following functionalities.
-	To get one element by using its Id, use Docment.Element(ElementId) method.
-	Retrieve all the walls in the current project.
-	Loop to get every wall and perform following actions
-	Get the wall’s local curve and create a new bound line with its start point and end point
-	Loop the wall’s geometry elements and find the two upright lines beside the line   created in step 1. Create a reference array contains the references of the two lines
-	Create a new bound line which is close and parallel to the line in step 1
-	Create a dimension for the wall using the reference array as its bounds and the parallel line as its place

Instructions: 
1.	Open Revit Structure.
2.	Draw some walls which have analytical model lines and select them
3.	Make sure that the active view is not a View3D or ViewSheet. 
4.	Execute the external Command.