Creates a new tab on the Revit user interface.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public virtual void CreateRibbonTab(
string tabName
) |
Visual Basic |
---|
Public Overridable Sub CreateRibbonTab ( _
tabName As String _
) |
Visual C++ |
---|
public:
virtual void CreateRibbonTab(
String^ tabName
) |
Parameters
- tabName
- Type: System..::..String
The name of the tab to be created.
Remarks
Examples
CopyC#
public Result OnStartup(UIControlledApplication application)
{
String tabName = "This Tab Name";
application.CreateRibbonTab(tabName);
PushButtonData button1 = new PushButtonData("Button1", "My Button #1",
@"C:\ExternalCommands.dll", "Revit.Test.Command1");
PushButtonData button2 = new PushButtonData("Button2", "My Button #2",
@"C:\ExternalCommands.dll", "Revit.Test.Command2");
RibbonPanel m_projectPanel = application.CreateRibbonPanel(tabName, "This Panel Name");
List<RibbonItem> projectButtons = new List<RibbonItem>();
projectButtons.AddRange(m_projectPanel.AddStackedItems(button1, button2));
return Result.Succeeded;
}
CopyVB.NET
Public Function OnStartup(application As UIControlledApplication) As Autodesk.Revit.UI.Result Implements IExternalApplication.OnStartup
Dim tabName As [String] = "This Tab Name"
application.CreateRibbonTab(tabName)
Dim button1 As New PushButtonData("Button1", "My Button #1", "C:\ExternalCommands.dll", "Revit.Test.Command1")
Dim button2 As New PushButtonData("Button2", "My Button #2", "C:\ExternalCommands.dll", "Revit.Test.Command2")
Dim m_projectPanel As RibbonPanel = application.CreateRibbonPanel(tabName, "This Panel Name")
Dim projectButtons As New List(Of RibbonItem)()
projectButtons.AddRange(m_projectPanel.AddStackedItems(button1, button2))
Return Result.Succeeded
End Function
Exceptions
See Also