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);