/// <summary> /// Adds ventilation parameters necessary for scheduling to the model /// if they do not already exist /// </summary> /// <param name="doc"></param> public static void AddVentParametersToModel(Document doc) { var spaceCat = doc.Settings.Categories.get_Item(BuiltInCategory.OST_MEPSpaces); var ventParams = VentilationParameterFactory.GetVentParameterDefinitions(doc); foreach (var p in ventParams) { if (!doc.HasParameter(p)) { RevitParameterUtility.BindParameterToCategory(doc, spaceCat, p); } } }
/// <summary> /// Adds ventilation parameters necessary for scheduling to the model /// if they do not already exist /// </summary> /// <param name="doc"></param> public static void AddVentParametersToModel(Document doc) { var spaceCat = doc.Settings.Categories.get_Item(BuiltInCategory.OST_MEPSpaces); var buildLocation = Path.GetDirectoryName(typeof(VentilationParameterUtility).Assembly.Location); var dirname = Path.Combine(buildLocation, "Data"); var paramFile = Path.Combine(dirname, ParameterFileName); var spFile = RevitParameterUtility.AddSharedParameterFileToModel(doc.Application, paramFile); var ventParams = VentilationParameterFactory.GetVentParameterDefinitions(doc); foreach (var p in ventParams) { if (!doc.HasParameter(p)) { RevitParameterUtility.BindParameterToCategory(doc, spaceCat, p); } } }