public static List<string> GetSubDisciplines(this Autodesk.Revit.DB.View view)
{
List<string> result = new List<string>();
var collector = new FilteredElementCollector(view.Document);
var views = collector.OfClass(typeof(View)).ToList<View>();
foreach (var v in views)
{
if (v.ViewType == ViewType.Internal || (v is ViewSheet))
continue;
foreach (Parameter p in v.Parameters)
{
if (p != null && p.Definition != null && p.Definition.Name == "子规程")
{
string subdiscipline = p.GetParameterString();
if (!string.IsNullOrEmpty(subdiscipline) && !result.Contains(subdiscipline))
result.Add(subdiscipline);
}
}
}
result.Sort();
return result;
}