GetUserWorksetInfo Method


Gets information about user worksets in a workshared model file, without fully opening the file.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2012

Syntax

C#
public static IList<WorksetPreview> GetUserWorksetInfo(
	ModelPath path
)
Visual Basic
Public Shared Function GetUserWorksetInfo ( _
	path As ModelPath _
) As IList(Of WorksetPreview)
Visual C++
public:
static IList<WorksetPreview^>^ GetUserWorksetInfo(
	ModelPath^ path
)

Parameters

path
Type: Autodesk.Revit.DBModelPath
The path to the workshared model.

Return Value

Information about all the user worksets in the model. The list is sorted by workset id.

Remarks

This method provides a preview of the user worksets available in a file, allowing an application to look up the necessary workset ids and information to properly fill out a WorksetConfiguration structure before opening or linking to this model.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsCentralModelAccessDeniedException 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.
Autodesk.Revit.ExceptionsCentralModelContentionException The central model are locked by another client.
Autodesk.Revit.ExceptionsCentralModelException The central model is missing. -or- The central model is corrupt or not an RVT file. -or- The model is not workshared. -or- The central model is overwritten by other user. -or- An internal error happened on the central model, please contact the server administrator.
Autodesk.Revit.ExceptionsFileAccessException The model could not be accessed due to lack of access privileges.
Autodesk.Revit.ExceptionsFileArgumentNotFoundException The Revit model specified by path doesn't exist.
Autodesk.Revit.ExceptionsFileNotFoundException The model could not be found at the specified path.
Autodesk.Revit.ExceptionsInvalidOperationException This functionality is not available in Revit LT.
Autodesk.Revit.ExceptionsRevitServerCommunicationException The server-based central model could not be accessed because of a network communication error.
Autodesk.Revit.ExceptionsRevitServerInternalException An internal error happened on the server, please contact the server administrator.

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →