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 Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →