Workset
Description:
Represents a workset in the document.
Represents a workset in the document.
Remarks:
Worksets are a way to divide a set of elements in the Revit document into subsets for worksharing. There may be one or many worksets in a document. Each element in the document must belong to one and only one workset.
Worksets are a way to divide a set of elements in the Revit document into subsets for worksharing. There may be one or many worksets in a document. Each element in the document must belong to one and only one workset.
public class Workset : WorksetPreview
public void GetWorksetsInfo(Document doc)
{
String message = String.Empty;
// Enumerating worksets in a document and getting basic information for each
FilteredWorksetCollector collector = new FilteredWorksetCollector(doc);
// find all user worksets
collector.OfKind(WorksetKind.UserWorkset);
// get information for each workset
int count = 3; // show info for 3 worksets only
foreach (Workset workset in collector)
{
message += "Workset : " + workset.Name;
message += "\nUnique Id : " + workset.UniqueId;
message += "\nOwner : " + workset.Owner;
message += "\nKind : " + workset.Kind;
message += "\nIs default : " + workset.IsDefaultWorkset;
message += "\nIs editable : " + workset.IsEditable;
message += "\nIs open : " + workset.IsOpen;
message += "\nIs visible by default : " + workset.IsVisibleByDefault;
TaskDialog.Show("GetWorksetsInfo", message);
if (0 == --count)
break;
}
}
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| Create(Document, String) | Workset | Creates a new workset. | |
| Dispose() | None | (Inherited from WorksetPreview ) | WorksetPreview |
| Equals | None | Determines whether the specified object is equal to the current object. (Inherited from Object ) | Object |
| GetHashCode | None | Serves as the default hash function. (Inherited from Object ) | Object |
| GetType | None | Gets the Type of the current instance. (Inherited from Object ) | Object |
| ToString | None | Returns a string that represents the current object. (Inherited from Object ) | Object |
| Name | Return Type | Description | Inherited From |
|---|---|---|---|
| Id | WorksetId | Id of the workset. (Inherited from WorksetPreview ) | WorksetPreview |
| IsDefaultWorkset | bool | Whether the workset is the default one. (Inherited from WorksetPreview ) | WorksetPreview |
| IsEditable | bool | Whether the workset is editable. | |
| IsOpen | bool | Whether the workset is open (rather than closed). | |
| IsValidObject | Boolean | Specifies whether the .NET object represents a valid Revit entity. (Inherited from WorksetPreview ) | WorksetPreview |
| IsVisibleByDefault | bool | Whether the workset is visible by default. | |
| Kind | WorksetKind | Kind of the workset. | |
| Name | string | Name of the workset. (Inherited from WorksetPreview ) | WorksetPreview |
| Owner | string | User name of the workset. (Inherited from WorksetPreview ) | WorksetPreview |
| UniqueId | Guid | UniqueId of the workset. (Inherited from WorksetPreview ) | WorksetPreview |