Execute the service by the given server.
Namespace: Autodesk.Revit.DB.ExternalServiceAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2013
Syntax
C# |
---|
public static ExternalServiceResult ExecuteService( Guid executionKey, Guid serverId, IExternalData data ) |
Visual Basic |
---|
Public Shared Function ExecuteService ( _ executionKey As Guid, _ serverId As Guid, _ data As IExternalData _ ) As ExternalServiceResult |
Visual C++ |
---|
public: static ExternalServiceResult ExecuteService( Guid executionKey, Guid serverId, IExternalData^ data ) |
Parameters
- executionKey
- Type: System..::..Guid
Access key of the service to be executed. The key is not the same as the service's Id. It is the value that was returned to the caller who registered the service.
- serverId
- Type: System..::..Guid
the specific server to execute
- data
- Type: Autodesk.Revit.DB.ExternalService..::..IExternalData
The associated data. The type must be of the class defined by the service.
Return Value
The result of executing the external service.
Remarks
Execution of a service should be invoked only by the application that registered the service. The execution will use the given server.
The serverId must be of a valid server that is currently registered for the service, ArgumentException be thrown if it is not available.
Because this method executes an explicitly specified server regardless of what other servers are currently active, it can only be invoked for a service that is not set as being recordable.
Plese also note that this method does not have any effect on active servers currently set for the service.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | The execution key is either invalid or of a service that is not registered. To execute a service, the key returned by RegisterService method must be used. -or- The execution key is of a service that is already being executed. -or- The serverId is either invalid or or the server not registered to the service. |
Autodesk.Revit.Exceptions..::..ArgumentNullException | A non-optional argument was NULL |
Autodesk.Revit.Exceptions..::..InvalidOperationException | The service is recordable. This method is intended for executing of non-recordable service. -or- The service provider is not available. |