Message 1 of 7

Not applicable
05-22-2016
02:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody!
I am working on a tool that creates schematics. I need to delete some elements (detail items) only in a given area of my drafting view.
In the above example I need to remove the lower detail item and keep the other two. I am trying to use the ElementOwnerViewFilter combined with the BoundingBoxIntersectsFilter as shown below.
private void CleardBArea (ElementId vId, int dBPos, double width, double height)
{
XYZ min = new XYZ(0,(height / 4) * dBPos,0);
XYZ max = new XYZ(width,(height /4) * (dBPos + 1),0);
Outline outline = new Outline(min,max);
BoundingBoxIntersectsFilter bbF = new BoundingBoxIntersectsFilter(outline);
ElementOwnerViewFilter eOVF = new ElementOwnerViewFilter(vId);
FilteredElementCollector vColl = new FilteredElementCollector(this.ActiveUIDocument.Document).WherePasses(eOVF).WherePasses(bbF);
ClearElements(vColl);
}
It works fine if I try to delete lines, but unfortunately, when I try to delete detail items, the filter ignores it.
Could you please recomend any other way to develop it?
thanks in advance
Solved! Go to Solution.