Application: LevelsProperty
Revit Platform: All
Revit Version: 2009.0
First Released For: 9.0
Last Modified: 02/26/2008
Modified By: JL Autodesk
Programming Language: C#
Skill Level: Beginning
Category: Create
Type: ExternalCommand

Subject: Display and Create Levels.
Summary: 
This sample demonstrates how to get all the levels in a document, and how to create or delete a level and set its properties.

Classes: 
Autodesk.Revit.IExternalCommand
Autodesk.Revit.Elements.Level
Autodesk.Revit.Creation.Document

Project Files:
Command.cs
This file contains the functions that how to get all the levels in a Revit file, how to create a level and set its properties and implement the IExternalCommand interface.

LevelsDataSource.cs
This file contains the LevelsDataSource Class which used to store the data of a level in Revit.

Description: 
-	Display a list of all Levels in the current document, with their name and elevation. All the levels can be found by iterating through the current document elements.
-	Create a new level with a unique name and an elevation. A new level can be created by using the NewLevel method which belongs to the Autodesk.Revit.Creation.Document Class.
-	Delete a level.
-	A level’s name and elevation can be set by the Name and Elevation property in the Autodesk.Revit.Element.Level Class. The name of a Level should be unique.

Instructions: 
1.	Open a Revit document which contains some levels.
2.	Run the sample, it will get all levels in current document.
3.	Click the Add button to create a new level.
4.	Selected a level in the list to set its name and elevation, click Ok button to finish set.
5.	Click the Delete button to delete a selected level in the list, click Ok button to finish it.