Adds a new pushbutton to the pulldown button and associates it with an ExternalCommand.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public PushButton AddPushButton( PushButtonData buttonData ) |
Visual Basic |
---|
Public Function AddPushButton ( _ buttonData As PushButtonData _ ) As PushButton |
Visual C++ |
---|
public: PushButton^ AddPushButton( PushButtonData^ buttonData ) |
Parameters
- buttonData
- Type: Autodesk.Revit.UI..::..PushButtonData
An object containing the data needed to construct the pushbutton.
Return Value
The newly added pushbutton.
Remarks
The new button will display its large image if PushButton.LargeImage is set.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentNullException | Thrown when buttonData is nullNothingnullptra null reference (Nothing in Visual Basic). |
Autodesk.Revit.Exceptions..::..ArgumentException | Thrown when button with buttonData.Name already exists in the button. |