做revit开发的过程中我们要对revit工作集进行操作的时候我们要用到一个类 FilteredWorksetCollector 用这个类我们可以过滤到所有的工作集,然后根据工作集的分类 枚举 WorksetKind 来取得想要的工作集类别集合。
以上代码我们获取了用户创建的工作集,如果想获取去他类别的工作集,我们只需要改变枚举值为目标枚举值即可 这四种枚举值分别 对应
// // 摘要: // Indicates one of the standard kinds of workset (as available in the UI). public enum WorksetKind { // // 摘要: // Any workset which is not one of the standard types included in this enum. OtherWorkset = 0, // // 摘要:族 // Workset containing a family. FamilyWorkset = 1, // // 摘要:视图 // Workset containing a view. ViewWorkset = 2, // // 摘要:项目标准 // Workset containing a standard. StandardWorkset = 3, // // 摘要:用户创建 // Workset defined by users, including the two default worksets created by Revit UserWorkset = 4 }