This method will simply switch the active state of a server without affecting in any way the other servers.
Namespace: Autodesk.Revit.DB.ExternalService
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.2.0.0 (26.2.0.0)
Syntax
C#
public bool SetServerState( Guid serverId, Document document, bool bActive )
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
BooleanTrue if operation succeeded (even if the server state was not changed), false otherwise (e.g. when serverId is invalid).
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | For a service that doesn't support activation, the servers can't be activated/deactivated. |