Example #1
0
        public static IList <DesignOptionSet> GetDesignOptionSets(Document document)
        {
            Dictionary <ElementId, List <DesignOption> > dic = new Dictionary <ElementId, List <DesignOption> >();
            var allDesignOptions = new FilteredElementCollector(document).OfClass(typeof(DesignOption)).Cast <DesignOption>();

            foreach (DesignOption dOpt in allDesignOptions)
            {
                Element dosElem = document.GetElement(dOpt.get_Parameter(BuiltInParameter.OPTION_SET_ID).AsElementId());
                dic.TryAddValue(dosElem.Id, dOpt);
            }
            List <DesignOptionSet> list = new List <DesignOptionSet>();

            foreach (var pair in dic)
            {
                var dos = new DesignOptionSet();
                dos.DesignOptionSet_revit = document.GetElement(pair.Key);
                dos.DesignOptions         = pair.Value.Cast <DesignOption>().ToList();
                list.Add(dos);
            }
            return(list);
        }
Example #2
0
 public DesignOptionWrapper(DesignOptionSet _set, DesignOption _deOp)
 {
     this.DesignOptionSet = _set;
     this.DesignOption    = _deOp;
 }