项目中所有的构件
程序员文章站
2022-04-29 20:30:18
...
var allEles = fecNonType.WhereElementIsNotElementType().Where(ele => ele.Category != null && ele.Category.CategoryType == CategoryType.Model && ele.Category.AllowsBoundParameters == true
).ToList();
var allTs = (from ele in allEles
where ele.Category != null && ele.Category.CategoryType == CategoryType.Model && ele.Category.AllowsBoundParameters == true && ele.GetTypeId() != ElementId.InvalidElementId
select doc.GetElement(ele.GetTypeId()) as ElementType).Distinct(new EleTypeEqualityComparer());
//FilteredElementCollector fec = new FilteredElementCollector(doc);
//ElementClassFilter filter01 = new ElementClassFilter(typeof(HostObjAttributes));
//ElementClassFilter filter02 = new ElementClassFilter(typeof(InsertableObject));
//LogicalOrFilter orFilter = new LogicalOrFilter(filter01, filter02);
////项目中所有的族类型
//var allTypes = fec.WherePasses(orFilter).Cast<ElementType>().ToList();
var grpTypes = allTs.GroupBy(
ele =>
{
if (ele.Category == null)
{
return "NullCate";
}
else
{
return ele.Category.Name;
}
}).ToList();
上一篇: 内置函数操作
下一篇: 糯米酒有什么功效与作用,吃法都有哪些?