EnableWorksharing Method

Enables worksharing in the document.

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


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


Type: System String
Name of workset for grids and levels.
Type: System String
Name of workset for all other elements.


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.


Exception Condition
Autodesk.Revit.Exceptions ArgumentException worksetNameGridLevel is an empty string. -or- worksetName is an empty string. -or- worksetNameGridLevel cannot include prohibited characters. -or- worksetName cannot include prohibited characters.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions ForbiddenForDynamicUpdateException This method may not be called during dynamic update.
Autodesk.Revit.Exceptions InvalidOperationException The document does not allow worksharing to be enabled. -or- This Document has is in an edit mode or is in family 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.Exceptions OperationCanceledException Enabling worksharing was cancelled.

See Also