Delete the specific workset.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
C#
public static void DeleteWorkset( Document document, WorksetId worksetId, DeleteWorksetSettings deleteWorksetSettings )
Parameters
- document Document
- The document containing the worksets.
- worksetId WorksetId
- The id of the workset to delete.
- deleteWorksetSettings DeleteWorksetSettings
- The settings to delete a workset.
Exceptions
Exception | Condition |
---|---|
ArgumentException | document is not a workshared document. -or- document is not a primary document, it is a linked document. -or- document is read-only: It cannot be modified. -or- There is no workset in the document with this id. -or- Workset cannot be deleted. |
ArgumentNullException | A non-optional argument was null |
ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
ModificationOutsideTransactionException | The document has no open transaction. |
RegenerationFailedException | The document regeneration fails during the DeleteWorkset operation. |