SplitButton Class

The SplitButton object represents a button with a clickable button appearing above a pulldown.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.UIRibbonItem
    Autodesk.Revit.UIRibbonButton
      Autodesk.Revit.UIPulldownButton
        Autodesk.Revit.UISplitButton

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class SplitButton : PulldownButton

The SplitButton type exposes the following members.

Properties
 NameDescription
Public propertyCurrentButtonGets or sets the current PushButton of the SplitButton.
Public propertyEnabledGets or sets a value indicating whether the item is enabled.
(Inherited from RibbonItem)
Public propertyImageThe image of the button.
(Inherited from RibbonButton)
Public propertyIsEnabledByContextIndicates if this button can be executed. True if the pushbutton is permitted to be executed based on the current Revit context (active document, active view and active tool). False if the pushbutton is disabled because of the active context.
(Inherited from RibbonButton)
Public propertyIsSynchronizedWithCurrentItem Indicates whether the top PushButton on the SplitButton changes based on the CurrentButton property.
Public propertyItemTextGets or sets the text displayed on the item.
(Inherited from RibbonItem)
Public propertyItemTypeGets the item type.
(Inherited from RibbonItem)
Public propertyLargeImageThe large image shown on the button.
(Inherited from RibbonButton)
Public propertyLongDescription Long description of the command tooltip
(Inherited from RibbonItem)
Public propertyNameThe name of the item.
(Inherited from RibbonItem)
Public propertyToolTipThe description that appears as a ToolTip for the item.
(Inherited from RibbonItem)
Public propertyToolTipImageThe image to show as a part of the button extended tooltip
(Inherited from RibbonItem)
Public propertyVisibleGets or sets a value indicating whether the item is visible.
(Inherited from RibbonItem)
Top
Methods
 NameDescription
Public methodAddPushButtonAdds a new pushbutton to the pulldown button and associates it with an ExternalCommand.
(Inherited from PulldownButton)
Public methodAddSeparatorAdds a separator to the drop-down list.
(Inherited from PulldownButton)
Public methodEquals Determines whether the specified Object is equal to the current Object.
(Inherited from RibbonItem)
Public methodGetContextualHelpGets the contextual help bound with this control.
(Inherited from RibbonItem)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetItemsGets a copy of the collection of buttons assigned to the pulldown button.
(Inherited from PulldownButton)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodSetContextualHelpSets the contextual help bound with this button.
(Inherited from RibbonItem)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Remarks
Use of this class is not supported in Revit Macros.
Example
private void AddSplitButton(RibbonPanel panel)
{
    string assembly = @"D:\Sample\HelloWorld\bin\Debug\HelloWorld.dll";

    // create push buttons for split button drop down
    PushButtonData bOne = new PushButtonData("ButtonNameA", "Option One",
        assembly, "Hello.HelloOne");
    bOne.LargeImage = 
        new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\One.bmp"));

    PushButtonData bTwo = new PushButtonData("ButtonNameB", "Option Two",
        assembly, "Hello.HelloTwo");
    bTwo.LargeImage = 
        new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Two.bmp"));

    PushButtonData bThree = new PushButtonData("ButtonNameC", "Option Three",
        assembly, "Hello.HelloThree");
    bThree.LargeImage = 
        new BitmapImage(new Uri(@"D:\Sample\HelloWorld\bin\Debug\Three.bmp"));

    SplitButtonData sb1 = new SplitButtonData("splitButton1", "Split");
    SplitButton sb = panel.AddItem(sb1) as SplitButton;
    sb.AddPushButton(bOne);
    sb.AddPushButton(bTwo);
    sb.AddPushButton(bThree);
}
See Also