Revit 2011 API provides user ways to create their own ribbon panel & buttons. Plus the shortcut capability, it makes addins similar as built-in functionalities. To add your own ribbon stuff, you only need to implement the IExternalApplication interface, and in the OnStartup function, write code like this:
public Result OnStartup(UIControlledApplication uiControlledApplication)
{
// The location of this command assembly
string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
// begin to create custom Ribbon panel and command buttons.
// create a Ribbon panel.
RibbonPanel myPanel = uiControlledApplication.CreateRibbonPanel(“MyRibbonPanel”);
// the button in the new panel
PushButton pushButton = myPanel.AddItem(new PushButtonData(“MyPushButton”, “Command1″, assemblyPath, typeof(Command1).FullName)) as PushButton;
pushButton.ToolTip = “Command1″;
// the large image uses for tooltip
Command1.LargeImage = new BitmapImage(new Uri(Path.Combine(buttonImageDir, “Command1_Large.bmp”)));
// image uses for the button
Command1.Image = new BitmapImage(new Uri(Path.Combine(buttonImageDir, “Command1_Small.bmp”)));
RadioButtonGroupData radioButtonGroupData = new RadioButtonGroupData(“TypeSelector”);
RadioButtonGroup radioButtonGroup = (RadioButtonGroup)(myPanel.AddItem(radioButtonGroupData));
ToggleButton toggleButton = radioButtonGroup.AddItem(new ToggleButtonData(“Type1″, “Type1″, assemblyPath, “MyApp.Type1″));
toggleButton.LargeImage = new BitmapImage(…large image uri);
toggleButton.Image = new BitmapImage(…image uri);
toggleButton = radioButtonGroup.AddItem(new ToggleButtonData(“Type2″, “Type2″, assemblyPath, “MyApp.Type1″));
toggleButton.LargeImage = new BitmapImage(…large image uri);
toggleButton.Image = new BitmapImage(…image uri);
return Result.Succeeded;
}
Go to the SDK\Samples\Ribbon\CS folder to get more detail examples.
If you want to use images added in the solution (so you don’t need external image file when deployment), you can add all needed image files in projects and set their “Build Action” in property as “Embedded Resource”, and get the ImageSource using following code:
System.IO.Stream file = app.GetManifestResourceStream(namespace + “.” + imageName);
PngBitmapDecoder bd = new PngBitmapDecoder(file, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
Please replace the namespace with your own namespace name.


