下載app免費領取會員
Revit API 里有個BuildingEnvelopeAnalyzer類,幫助文檔里對它描述如下:
This class uses a combination of ray-casting and flood-fill algorithms in order to find the building elements that are exposed to the outside of the building. This method can also look for the bounding building elements for enclosed space volumes inside the building.
大概意思就是說這個類可以獲取在建筑外面的建筑構件,
下面是一個小測試,
Document doc = commandData.Application.ActiveUIDocument.Document;
BuildingEnvelopeAnalyzerOptions opt = new BuildingEnvelopeAnalyzerOptions();
opt.AnalyzeEnclosedSpaceVolumes = true;
opt.OptimizeGridCellSize = false;
opt.GridCellSize = 1;
BuildingEnvelopeAnalyzer analyzer = BuildingEnvelopeAnalyzer.Create(doc, opt);
IList<LinkElementId> ids = analyzer.GetBoundingElements();
List<ElementId> nids = ids.Select(m => m.HostElementId).ToList();
UIDocument uidoc = new UIDocument(doc);
uidoc.Selection.SetElementIds(nids);
return Result.Succeeded;
本文版權歸腿腿教學網及原創作者所有,未經授權,謝絕轉載。
推薦專題