/// <summary> /// Gets the vent parameters necessary or creates them if they are unavailable /// </summary> /// <param name="schedule"></param> public static void AddVentParametersToSchedule(ViewSchedule schedule) { // check if doc has vent parameters // if not create them var hasVentParams = VentilationParameterUtility.ModelHasVentParameters(schedule.Document); var ventParams = hasVentParams ? VentilationParameterUtility.GetVentParametersFromModel(schedule.Document) : VentilationParameterUtility.CreateVentParametersInModel(schedule.Document); // add them to the schedule as schedulable fields VentilationParameterUtility.AddParameterToSchedule(schedule, ventParams.ToArray()); }
public static IList <Parameter> GetVentParameters(Document doc) { if (VentilationParameterUtility.ModelHasVentParameters(doc)) { return(VentilationParameterUtility.GetVentParametersFromModel(doc)); } var defs = GetVentParameterDefinitions(doc); var pars = new List <Parameter>(); foreach (var d in defs) { var p = doc.GetParameterFromCategory(BuiltInCategory.OST_MEPSpaces, d.Name); pars.Add(p); } return(pars); }