AddPushButton Method


Pulldown Button Add Push Button Method

Adds a new pushbutton to the pulldown button and associates it with an ExternalCommand.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public PushButton AddPushButton(
	PushButtonData buttonData
)

Parameters

buttonData PushButtonData
An object containing the data needed to construct the pushbutton.

Return Value

PushButton
The newly added pushbutton.
Exceptions
Exception Condition
ArgumentNullException Thrown when buttonData is .
ArgumentException Thrown when button with buttonData.Name already exists in the button.
Remarks
The new button will display its large image if PushButton.LargeImage is set.
See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →