internal Workset(revitDoc doc, revitWorkset workset) { _workset = workset; _id = workset.Id; _doc = doc; _name = workset.Name; }
private void _bakeButton_Click(object sender, EventArgs e) { // set selected category foreach (DB.Category category in Document.Settings.Categories) { if (category.Name == _categorySelector.SelectedKey) { AddinOptions.Current.CustomOptions.AddOption(OPTROOT, "LastSelectedCategory", category.Name); SelectedCategory = category.Id; } } // set selected workset if (Document.IsWorkshared) { foreach (DB.Workset workset in new DB.FilteredWorksetCollector(Document).OfKind(DB.WorksetKind.UserWorkset).ToWorksets()) { if (workset.Name == _worksetSelector.SelectedKey) { AddinOptions.Current.CustomOptions.AddOption(OPTROOT, "LastSelectedWorkset", workset.Name); SelectedWorkset = workset.Id; } } } IsCancelled = false; AddinOptions.Save(); Close(); }
/// <summary> /// Gets the workset ID of a workset. /// </summary> /// <param name="workset">The workset that you wish to set the visibility of.</param> /// <returns name="workset ID">The worksetID</returns> public static revitWorksetId Id(Workset workset) { revitWorksetId id = null; try { id = workset.internalWorkset.Id; } catch { id = null; } return(id); }