EnableWorksharing Method


Enables worksharing in the document.

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

Syntax

C#
public void EnableWorksharing(
	string worksetNameGridLevel,
	string worksetName
)
Visual Basic
Public Sub EnableWorksharing ( _
	worksetNameGridLevel As String, _
	worksetName As String _
)
Visual C++
public:
void EnableWorksharing(
	String^ worksetNameGridLevel, 
	String^ worksetName
)

Parameters

worksetNameGridLevel
Type: SystemString
Name of workset for grids and levels.
worksetName
Type: SystemString
Name of workset for all other elements.

Remarks

The document's Undo history will be cleared by this command. As a result, this command and others executed before it cannot be undone.

All transaction phases (e.g. transactions transaction groups and sub-transaction) that were explicitly started must be finished prior to calling this method.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException worksetNameGridLevel is an empty string. -or- worksetName is an empty string. -or- worksetNameGridLevel cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~". -or- worksetName cannot include prohibited characters, such as "{, }, [, ], |, ;, less-than sign, greater-than sign, ?, `, ~".
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsForbiddenForDynamicUpdateException This method may not be called during dynamic update.
Autodesk.Revit.ExceptionsInvalidOperationException The document does not allow worksharing to be enabled. -or- This Document is in an edit mode. -or- This Document is a workshared document. -or- There is a transaction phase left open (such as a transaction, sub-transaction of transaction group) at the time of invoking this method.
Autodesk.Revit.ExceptionsOperationCanceledException Enabling worksharing was cancelled.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →