public static void SetParameters(Element ele, CC_CoreData.Instance inst) { for (int i = 0; i < inst.Values.Count(); i++) { //ParamEdits.UpdateParameter(ele, inst.Values[i]); } Parameter ToFileParam = ele.get_Parameter(ParameterLibrary.ToFile.ID); ToFileParam.Set(1); }
public static CC_CoreData.Instance[] GetKeySchedInstances(ViewSchedule v, Param[] p) { IEnumerable <Element> eles = from e in new FilteredElementCollector(v.Document, v.Id) select e; CC_CoreData.Instance[] instances = new CC_CoreData.Instance[eles.Count()]; int j = 0; for (int i = 0; i < eles.Count(); i++) { instances[j] = GetParamValues(eles.ElementAt(i), p); j++; } return(instances); }
public static CC_CoreData.Instance[] GetInstances(List <Element> ElementList, Param[] Paramset) { Document currentDoc = ElementList.FirstOrDefault().Document; ProjectInfo info = currentDoc.ProjectInformation; List <CC_CoreData.Instance> instances = new List <CC_CoreData.Instance>(); for (int i = 0; i < ElementList.Count(); i++) { FamilySymbol symb = ElementList[i] as FamilySymbol; Family fam = symb.Family; if (ElementList[i].get_Parameter(ParameterLibrary.ToFile.ID) != null) { Parameter inclparam = ElementList[i].get_Parameter(ParameterLibrary.ToFile.ID); if (inclparam.AsInteger() == 1) { Couplet[] pairs = new Couplet[Paramset.Count()]; for (int j = 0; j < pairs.Count(); j++) { if (ElementList[i].get_Parameter(Paramset[j].ID) != null) { //Couplet pair = ParamEdits.GetParameterValue(Paramset[j], ElementList[i]); //pairs[j] = pair; } else { Couplet pair = new Couplet(Paramset[j], ""); pairs[j] = pair; } } CC_CoreData.Instance e = new CC_CoreData.Instance(pairs); instances.Add(e); } } } return(instances.ToArray()); }
private static void SetParamValues(Element e, CC_CoreData.Instance instance, Param[] p, bool AdjustComments) { foreach (Parameter par in e.Parameters) { if (par.Definition.Name.ToUpper() == "COMMENTS" && AdjustComments) { par.Set(instance.Values[1].Value); } if (p.Any(x => x.ShortName == par.Definition.Name.ToUpper())) { par.Set(instance.Values[Array.IndexOf(p, p.Where(x => x.ShortName == par.Definition.Name.ToUpper()).First())].Value); } else { if (p.Any(x => x.AlternateNames.Any(y => y == par.Definition.Name.ToUpper()))) { par.Set(instance.Values[Array.IndexOf(p, p.Where(x => x.AlternateNames. Any(y => y == par.Definition.Name.ToUpper())).First())].Value); } } } e.get_Parameter(BuiltInParameter.REF_TABLE_ELEM_NAME).Set(instance.Values[0].Value); }