Obtains ownership for the current user of as many specified worksets as possible.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public static ISet<WorksetId> CheckoutWorksets(
Document document,
ISet<WorksetId> worksetsToCheckout,
TransactWithCentralOptions options
)
Parameters
- document Document
-
The document containing the worksets.
- worksetsToCheckout ISet<WorksetId>
-
The ids of the worksets to attempt to check out.
- options TransactWithCentralOptions
-
Options to customize access to the central model.
null is allowed and means no customization.
Return Value
ISet<WorksetId>
The ids of all specified worksets that are now owned,
including all that were owned prior to the function call.
Exceptions
| Exception | Condition |
|---|
| ArgumentException |
document is not a workshared document.
-or-
document is not a primary document, it is a linked document.
-or-
document is read-only: It cannot be modified.
-or-
document has an open editing transaction and is accepting changes.
-or-
There are one or more ids with no corresponding workset.
-or-
Saving is not allowed in the current application mode.
|
| ArgumentNullException |
A non-optional argument was null
|
| CentralFileCommunicationException |
The file-based central model could not be reached,
e.g. the network is down or the file server is down.
|
| CentralModelAccessDeniedException |
Access to the central model was denied due to lack of access privileges.
-or-
Access to the central model was denied. A possible reason is because the model was under maintenance.
|
| CentralModelContentionException |
The central model are locked by another client.
|
| CentralModelException |
The central model is overwritten by other user.
-or-
The central model is missing.
-or-
An internal error happened on the central model, please contact the server administrator.
|
| CentralModelVersionArchivedException |
Last central version merged into the local model has been archived in the central model.
This exception could only be thrown from cloud models.
|
| InvalidOperationException |
Operation is not permitted when there is any open sub-transaction, transaction, or transaction group.
|
| RevitServerCommunicationException |
The server-based central model could not be accessed
because of a network communication error.
|
| RevitServerInternalException |
An internal error happened on the server, please contact the server administrator.
|
Remarks
For best performance, check out all worksets in one big call, rather than many small calls.
See Also
Reference