Application: Toolbar
Revit Platform: All
Revit Version: 2009.0
First Released For: 2008.0
Last Modified: 02/26/2008
Modified By: CL Autodesk
Programming Language: VB.NET
Skill Level: Beginning
Category: Mechanism (ui)
Type: ExternalApplication

Subject: Create custom toolbar.
Summary: 
This sample demonstrates how to create custom toolbar and how to create different types toolbar items.

Classes: 
Autodesk.Revit.IExternalCommand 
Autodesk.Revit.IExternalApplication
Autodesk.Revit.Toolbar
Autodesk.Revit.ToolbarItem
Autodesk.Revit.MenuItem
Autodesk.Revit.Creation.Document

Project Files: 
ExternalApplication.vb
The main DLL source file contains the class CreateToolbar which inherits from interface IExternalApplication and implements method OnStartUp. The class will add a custom toolbar with three buttons 

Description: 
This sample provides the following functionalities:
-	Add a custom toolbar with three buttons into Revit and Use Application.NewToolbar() to create the Toolbar via API. 
-	Add a Custom Toolbar with three buttons into Revit. 
-	Between the second button and the third button there is a separator.
-	Every button should have a corresponding command to execute. The command should implement the interface of IExternalCommand.
-	The first button will create a wall. Use Toolbar.AddItem(MenuItem) to add this button .
-	The second button will delete all walls in current project. Use Toolbar.AddItem(String, String) to add this button .
-	The third button will pop up a dialog box and show some information about Customer Toolbar.
-	There are two types of ToolbarItem, the third button has image only and the others two have both image and text.
-	Every button has a ToolTip when mouse on it.
-	Every button has a tip in Revit status bar to describe the button usage when it gets focus.
Implementation Notes
-	The command, which will be executed when the ToolbarItem button is clicked, should derive from IExternalCommand.
-	The Toolbar can be created via API: Application.NewToolbar().
-	The ToolbarItem button can be added via API: Toobar.AddItem(MenuItem) or Toobar.AddItem(String, String).
-	The separator is a ToolbarItem too, we can use AddItem(nullptr) to create this separator; or we can set the ToolbarItem’s ToolbarItemType property with ToolbarItemType::BtnSeparator.
-	The Image property of toolbar will affect the image of each ToolbarItem. Besides, the ImageIndex of toolbar will affect the image of ToolbarItem too.
-	ToolbarItem.ToolTip can set the tip when mouse move on the ToolbarItem button.
-	ToolbarItem.StatusbarTip can set the tip in Revit status bar when the ToolbarItem button gets focus.

Instructions: 
1.	Make sure there are following settings in Revit.ini file.
[ExternalApplications] 
EACount = 1 
EAName1 = Custom Toolbar
EAClassName1 = Revit.SDK.Samples.Toolbar.VB.NET.CreateToolbar 
EAAssembly1 = (your path)\Toolbar.dll 
EADescription1 = "Add a Custom Toolbar with three buttons into Revit"
2.	Copy the Commands.dll and Toolbar.bmp to the same directory of this sample dll.
3.	Run Revit, then you can see the custom toolbar with three buttons in Revit. 
4.	Click the first button will create a wall in Revit; click the second button will delete all walls in Revit, click the third button will pop up a dialog which list some information about custom toolbar.

Notes: 
1.	When compile this sample, please make sure you have compiled the Commands sample successfully.