UIApplication.CreateRibbonPanel
Description:
Create a new RibbonPanel on the Add-Ins tab.
Create a new RibbonPanel on the Add-Ins tab.
Remarks:
This method will create a custom panel appending to the Revit AddIns tab. This method is not supported in Macros.
This method will create a custom panel appending to the Revit AddIns tab. This method is not supported in Macros.
Overloads (3):
CreateRibbonPanel(String)
public virtual RibbonPanel CreateRibbonPanel(
string panelName
)
-
StringpanelNameThe name of the panel to be created.
public Result OnStartup(UIControlledApplication application)
{
// add new ribbon panel
RibbonPanel ribbonPanel = application.CreateRibbonPanel("NewRibbonPanel");
//Create a push button in the ribbon panel “NewRibbonPanel”
//the add-in application “HelloWorld” will be triggered when button is pushed
PushButton pushButton = ribbonPanel.AddItem(new PushButtonData("HelloWorld",
"HelloWorld", @"D:\HelloWorld.dll", "HelloWorld.CsHelloWorld")) as PushButton;
// Set the large image shown on button
Uri uriImage = new Uri(@"D:\Sample\HelloWorld\bin\Debug\39-Globe_32x32.png");
BitmapImage largeImage = new BitmapImage(uriImage);
pushButton.LargeImage = largeImage;
return Result.Succeeded;
}
-
panelName is.
-
panelName is Empty.
-
If more than 100 panels were created.