Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an issue selecting beams that are cut by the view plane. Unfortunately the code returns nothing.
public void Show()
{
UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
BoundingBoxXYZ box = doc.ActiveView.CropBox;
Outline outline = new Outline(box.Min, box.Max);
BoundingBoxIntersectsFilter beamintersect = new BoundingBoxIntersectsFilter(outline);
List<Element> beams = new FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_StructuralFraming).WherePasses(beamintersect).WhereElementIsNotElementType().ToElements().ToList();
ICollection<ElementId> idc = new List<ElementId>();
foreach (var element in beams)
{
ElementId id = element.Id;
idc.Add(id);
}
uidoc.Selection.SetElementIds(idc);
uidoc.ShowElements(idc);
Solved! Go to Solution.