Hi mate,
I have many detail items outside crop region.
But i only want to select detail items inside crop region.
I use code like this but it collect both inside and outside detail items.
What can i do ?
Thank in advanced !
List<FamilyInstance> symbols = new FilteredElementCollector(doc, doc.ActiveView.Id)
.OfClass(typeof(FamilyInstance))
.WhereElementIsNotElementType()
.Where(x => x.Category.Name == "Detail Items")
.Where(x => x.IsHidden(doc.ActiveView) == false)
.Cast<FamilyInstance>()
.ToList();
Solved! Go to Solution.
Solved by naveen.kumar.t. Go to Solution.
Hi @mr.engineer.aec ,
One solution is to get the bounding box from the crop box and create a BoundingBoxIntersectsFilter.
if(doc.ActiveView.CropBoxVisible && doc.ActiveView.CropBoxActive)
{
BoundingBoxXYZ bb = doc.ActiveView.CropBox;
Outline myOutLn = new Outline(bb.Min, bb.Max);
BoundingBoxIntersectsFilter filter = new BoundingBoxIntersectsFilter(myOutLn);
}
Now use this BoundingBoxIntersectsFilter along with other filters in FilteredElementCollector to get the required elements.
Could you please try this suggestion and let me know?
Thank @naveen.kumar.t for reply,
I think if use boundingbox it'll collect detail items like this so,
I want to collect only inside mate.
Hi @mr.engineer.aec ,
Could you please try using BoundingBoxIsInsideFilter.
https://www.revitapidocs.com/2023/eb8735d7-28fc-379d-9de9-1e02326851f5.htm
Can't find what you're looking for? Ask the community or share your knowledge.