SetActiveServer Method (Guid)


Set an active server applicable application-wide for the service.

Namespace: Autodesk.Revit.DB.ExternalService
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2013

Syntax

C#
public void SetActiveServer(
	Guid serverId
)
Visual Basic
Public Sub SetActiveServer ( _
	serverId As Guid _
)
Visual C++
public:
void SetActiveServer(
	Guid serverId
)

Parameters

serverId
Type: System Guid
Id of the application server.

Remarks

Only one server can be active at any given time in a single-server service, but it is possible that no server is active (unless the service is mandatory).

An application-wide active server gets executed when the service is invoked in the scope of the entire application (i.e. without a specific document), or if the service is executed in a document but the document does not have an active server explicitly set.

It is possible to set a server as active when another server is already active for that service. Making a server active will automatically deactivate the server that was active before this call.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The given Id is not of a server registered with the service.
Autodesk.Revit.Exceptions InvalidOperationException The operation is not allowed because the service is being executed.

See Also