Execute Method


Overload this method to implement and external command within Revit.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
Result Execute(
	ExternalCommandData commandData,
	out string message,
	ElementSet elements
)
Visual Basic
Function Execute ( _
	commandData As ExternalCommandData, _
	<OutAttribute> ByRef message As String, _
	<OutAttribute> elements As ElementSet _
) As Result
Visual C++
Result Execute(
	ExternalCommandData^ commandData, 
	[InAttribute] [OutAttribute] String^% message, 
	[InAttribute] [OutAttribute] ElementSet^ elements
)

Parameters

commandData
Type: Autodesk.Revit.UI ExternalCommandData
An ExternalCommandData object which contains reference to Application and View needed by external command.
message
Type: System String %
Error message can be returned by external command. This will be displayed only if the command status was "Failed". There is a limit of 1023 characters for this message; strings longer than this will be truncated.
elements
Type: Autodesk.Revit.DB ElementSet
Element set indicating problem elements to display in the failure dialog. This will be used only if the command status was "Failed".

Return Value

The result indicates if the execution fails, succeeds, or was canceled by user. If it does not succeed, Revit will undo any changes made by the external command.

See Also