Create a new RibbonPanel on the Add-Ins tab.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public virtual RibbonPanel CreateRibbonPanel(
string panelName
) |
Visual Basic |
---|
Public Overridable Function CreateRibbonPanel ( _
panelName As String _
) As RibbonPanel |
Visual C++ |
---|
public:
virtual RibbonPanel^ CreateRibbonPanel(
String^ panelName
) |
Parameters
- panelName
- Type: System..::..String
The name of the panel to be created.
Remarks
Examples
CopyC#
public Result OnStartup(UIControlledApplication application)
{
RibbonPanel ribbonPanel = application.CreateRibbonPanel("NewRibbonPanel");
PushButton pushButton = ribbonPanel.AddItem(new PushButtonData("HelloWorld",
"HelloWorld", @"D:\HelloWorld.dll", "HelloWorld.CsHelloWorld")) as PushButton;
Uri uriImage = new Uri(@"D:\Sample\HelloWorld\bin\Debug\39-Globe_32x32.png");
BitmapImage largeImage = new BitmapImage(uriImage);
pushButton.LargeImage = largeImage;
return Result.Succeeded;
}
CopyVB.NET
Public Function OnStartup(application As UIControlledApplication) As Autodesk.Revit.UI.Result Implements IExternalApplication.OnStartup
Dim ribbonPanel As RibbonPanel = application.CreateRibbonPanel("NewRibbonPanel")
Dim pushButton As PushButton = TryCast(ribbonPanel.AddItem(New PushButtonData("HelloWorld", "HelloWorld", "D:\HelloWorld.dll", "HelloWorld.CsHelloWorld")), PushButton)
Dim uriImage As New Uri("D:\Sample\HelloWorld\bin\Debug\39-Globe_32x32.png")
Dim largeImage As New BitmapImage(uriImage)
pushButton.LargeImage = largeImage
Return Result.Succeeded
End Function
Exceptions
See Also