Application: DeleteDimensions
Revit Platform: All
Revit Version: 2011.0
First Released For: 9.0
Programming Language: C#
Skill Level: Beginning
Category: Basics, Annotation
Type: ExternalCommand

Subject: Delete dimensions.
Summary: 
Show how to delete Dimension elements.

Classes: 
Autodesk.Revit.UI.IExternalCommand 
Autodesk.Revit.DB.Dimension
Autodesk.Revit.DB.Element

Project Files: 
DeleteDimesions.cs
This file contains a class Command that implements the IExternalCommand, the function of the class is to get the dimension objects from the selected elements and delete those that are not pinned.

Description: 
-	To get the select elements use Application.ActiveUIDocument.Selection.Elements.
-	To verify the dimension is pinned or not use Dimension.Pinned.
-	To delete a dimension use Document.Delete(ElementSet).

Instructions: 
1.	Open or new a Revit project and make sure all needed Dimensions are placed. A sample project file DeleteDimensions.rvt is available in the sample’s folder.
2.	Select some dimensions to be deleted.
3.	Run the command.
4.	The dimensions will be deleted if it is not pinned.