CanDeleteWorkset Method


Indicates if a workset can be deleted.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 23.0.0.0 (23.1.0.0)
Since: 2022.1

Syntax

C#
public static bool CanDeleteWorkset(
	Document document,
	WorksetId worksetId,
	DeleteWorksetSettings deleteWorksetSettings
)
Visual Basic
Public Shared Function CanDeleteWorkset ( _
	document As Document, _
	worksetId As WorksetId, _
	deleteWorksetSettings As DeleteWorksetSettings _
) As Boolean
Visual C++
public:
static bool CanDeleteWorkset(
	Document^ document, 
	WorksetId^ worksetId, 
	DeleteWorksetSettings^ deleteWorksetSettings
)

Parameters

document
Type: Autodesk.Revit.DB Document
The document containing the worksets.
worksetId
Type: Autodesk.Revit.DB WorksetId
The id of the workset to delete.
deleteWorksetSettings
Type: Autodesk.Revit.DB DeleteWorksetSettings
The settings to delete a workset.

Return Value

True if the workset can be deleted, false otherwise.

Remarks

The workset can't be deleted in the following cases:

  • The input worksetId is not valid in the document.
  • The input worksetId doesn't represent a user-created workset, which means this workset might be a system workset.
  • The workset is not editable by the current user. In order to resolve this problem, please checkout the workset by calling [!:Autodesk::Revit::DB::WorksharingUtils::CheckoutWorksets] .
  • The workset or some elements under the workset are owned by the other users. In order to resolve this problem, please ask the other users to call [!:Autodesk::Revit::DB::WorksharingUtils::RelinquishOwnership] to relinquish their ownership on the workset and elements.
  • The target workset is not a user-created workset.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null

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 →