Skip to content

WorksharingUtils.CheckoutElements(Document, ISet.ElementId., TransactWithCentralOptions)

Public Class

Obtains ownership for the current user of as many specified elements as possible.

Namespace: Autodesk.Revit.DB

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public static ISet<ElementId> CheckoutElements(
Document document,
ISet<ElementId> elementsToCheckout,
TransactWithCentralOptions options
)

Parameters

document Document

The document containing the elements.

elementsToCheckoutISet. ElementId.

The ids of the elements to attempt to check out.

options TransactWithCentralOptions

Options to customize access to the central model. . is allowed and means no customization.

Return Value

ISet. ElementId.
The ids of all specified elements that are now owned (but possibly out of date), 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- One or more elements in elementsToCheckout do not exist in the document. -or- Saving is not allowed in the current application mode.


ArgumentNullException

A non-optional argument was null


CentralFileCommunicationException

Editing permissions for the file-based central model could not be accessed for write, e.g. the network is down, central is missing, or central is read-only.


CentralModelAccessDeniedException

Access to the central model was denied. A possible reason is because the model was under maintenance.


CentralModelContentionException

Editing permissions for the central model are locked and the last attempt to lock was canceled. -or- The central model is being accessed by another client.


CentralModelException

An error has occurred while checking out worksets or elements. -or- 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.


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, checkout all elements in one big call, rather than many small calls.

Revit may check out additional elements that are needed to check out the elements you requested. For example, if you request an element that is in a group, Revit will check out the entire group.