OnCommand Method


IExternal Data Manager Server On Command Method

Handles user command.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntax
void OnCommand(
	Document document,
	ExternalDataManagerCommandId commandId,
	IList<ExternalDataManagerDataItemId> dataIds
)

Parameters

document Document
The document.
commandId ExternalDataManagerCommandId
The command name.
dataIds IList ExternalDataManagerDataItemId
The selected data ids.
Remarks
This is the main execution entry point when the user triggers a command through the dialog UI (context menu, or content tool). dataIds may be empty for commands that do not require selection (e.g. Add). Throwing an exception rolls back the surrounding transaction group and shows an error dialog.
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 →