Application: ProjectUnit
Revit Platform: All
Revit Version: 2011.0
First Released For: 2008.0
Programming Language: C#
Skill Level: Beginning
Category: Data Exchange, Basics
Type: ExternalCommand

Subject: List and set units and format options.
Summary: 
Add a command which lists all the units in the current project and displays their format information; Display the decimal symbol type of current project’s units. Users could set it to comma or dot; Display the slope type of current project units, users can set it to Rise or Angle.

Classes: 
Autodesk.Revit.UI.IExternalCommand 
Autodesk.Revit.DB.ProjectUnit
Autodesk.Revit.DB.FormatOptions

Project Files: 
Command.cs
The main DLL source file which contains the class Command which implements interface IExternalCommand. Get necessary data from revit and show the Form. 

ProjectUnitData.cs
This file contains a class which prepares the project unit data.

ProjectUnitForm.cs
This file contains a form class which retrieves or changes the project unit setting by API. include the decimal symbol type, the slope typesetting and some other format information.

Description: 
This sample should provide the following functionality:
-	Display the decimal symbol type of current project units and users can set it to comma or dot.
-	Display the slope type of current project units and users can set it to Rise or Angle.
-	List all the units in current project and display each unit’s format information.
-	List all the available Unit Discipline of current project in a list box
-	Classify the project units by the Unit Discipline
-	When users select one Unit Discipline in the list box to display the corresponding project units name (such as Length or Area) and its format information. The format information includes the display unit type (such as DUT_KIP_FEET_PER_DEGREE_PER_FOOT), the unit suffix type (such as UST_NONE), and the rounding (such as 0.2).

Instructions: 
1.	Open Revit.
2.	Invoke this command.
3.	The project unit form lists all the units in current project and displays each unit’s format information.
4.	Users can select the decimal symbol type and slope type of current project units
5.	Click the OK button in sample’s main UI.
6.	Application will reset the decimal symbol type and slope type.