UIControlledApplicationCreateRibbonPanel(String) Method |
Create a new RibbonPanel on the Add-Ins tab.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic virtual RibbonPanel CreateRibbonPanel(
string panelName
)
Public Overridable Function CreateRibbonPanel (
panelName As String
) As RibbonPanel
public:
virtual RibbonPanel^ CreateRibbonPanel(
String^ panelName
)
abstract CreateRibbonPanel :
panelName : string -> RibbonPanel
override CreateRibbonPanel :
panelName : string -> RibbonPanel
Parameters
- panelName String
- The name of the panel to be created.
Return Value
RibbonPanel
Exceptions
Remarks This method will create a custom panel appending to the Revit AddIns tab. This method is not supported in Macros.
Examplepublic 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;
}
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
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also