MultiServerServiceSetServerState Method |
This method will simply switch the active state of a server without affecting in any way the other servers.
Namespace: Autodesk.Revit.DB.ExternalServiceAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic bool SetServerState(
Guid serverId,
Document document,
bool bActive
)
Public Function SetServerState (
serverId As Guid,
document As Document,
bActive As Boolean
) As Boolean
public:
bool SetServerState(
Guid serverId,
Document^ document,
bool bActive
)
member SetServerState :
serverId : Guid *
document : Document *
bActive : bool -> bool
Parameters
- serverId Guid
-
Id of the server to switch active state for.
- document Document
-
Document for which to activate this server. If null, server will activate globally.
- bActive Boolean
-
True to activate server, false to deactivate.
Return Value
Boolean
True if operation succeeded (even if the server state was not changed), false otherwise (e.g. when serverId is invalid).
ExceptionsException | Condition |
---|
InvalidOperationException |
For a service that doesn't support activation, the servers can't be activated/deactivated.
|
Remarks
For a service which has cref="Autodesk::Revit::DB::ExternalService::SupportActivation" set to false
calling this method will throw exception.
See Also