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

Subject: Delete Objects.
Summary: 
This sample is used to delete the objects selected by user.

Classes: 
Autodesk.Revit.UI.IExternalCommand
Autodesk.Revit.DB.Document
Autodesk.Revit.UI.Selection.SelElementSet

Project Files: 
DeleteObject.cs
Class DeleteObject Implements the IExternalCommand interface and it deletes the selected objects.

Description: 
-	What the sample does is to get the objects selected and delete them, highlight objects which cannot be deleted.
-	Use Document.Delete(Element) to delete an element.
-	Use elements.Insert(Element) to highlight the element after return cancel or failed, elements is the parameter of the function Execute of IExternalCommand.

Instructions: 
1.	Select element(s) which you want to delete.
2.	Run this command.