Revit 2025 API
UIControlled |
Creates a new tab on the Revit user interface.
Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public virtual void CreateRibbonTab( string tabName )
Public Overridable Sub CreateRibbonTab ( tabName As String )
public: virtual void CreateRibbonTab( String^ tabName )
abstract CreateRibbonTab : tabName : string -> unit override CreateRibbonTab : tabName : string -> unit
Parameters
- tabName String
- The name of the tab to be created.

Exception | Condition |
---|---|
ArgumentNullException | tabName or panelName is . |
ArgumentException | tabName or panelName is Empty or the tab name duplicates the name of another tab in the Revit UI. |
InvalidOperationException | Too many custom tabs have been created in this session. (Maximum is 20). |

This method will create a custom tab at the end of the list of static tabs. If multiple tabs are added, they will be shown in the order added. This method is not supported in Macros.

public Result OnStartup(UIControlledApplication application) { // Create a custom ribbon tab String tabName = "This Tab Name"; application.CreateRibbonTab(tabName); // Create two push buttons 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"); // Create a ribbon panel RibbonPanel m_projectPanel = application.CreateRibbonPanel(tabName, "This Panel Name"); // Add the buttons to the panel List<RibbonItem> projectButtons = new List<RibbonItem>(); projectButtons.AddRange(m_projectPanel.AddStackedItems(button1, button2)); return Result.Succeeded; }
Public Function OnStartup(application As UIControlledApplication) As Autodesk.Revit.UI.Result Implements IExternalApplication.OnStartup ' Create a custom ribbon tab Dim tabName As [String] = "This Tab Name" application.CreateRibbonTab(tabName) ' Create two push buttons 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") ' Create a ribbon panel Dim m_projectPanel As RibbonPanel = application.CreateRibbonPanel(tabName, "This Panel Name") ' Add the buttons to the panel Dim projectButtons As New List(Of RibbonItem)() projectButtons.AddRange(m_projectPanel.AddStackedItems(button1, button2)) 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