欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Revit二次开发-4

程序员文章站 2022-04-02 09:39:43
...

输出外墙ID

UIDocument uidoc = revit.Application.ActiveUIDocument;
Document doc = revit.Application.ActiveUIDocument.Document;
FilteredElementCollector filteredElem = new FilteredElementCollector(doc);
ElementClassFilter classfilter = new ElementClassFilter(typeof(Wall));
filteredElem = filteredElem.WherePasses(classfilter);
foreach(Wall wall in filteredElem)
{
    var funPar = wall.WallType.get_Parameter(BuiltInParameter.FUNCTION_PARAM);
    if(funPar != null && funPar.StorageType == StorageType.Integer)
    {
        if(funPar.AsInteger() == (int)WallFunction.Exterior)
        {
            info += "\n\t" + wall.Id;
        }
    }
}
TaskDialog.Show("Revit", info);
相关标签: Revit