Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66662

Re: Delete an area in a drafting view

$
0
0

Dear Chema,

 

This is my post nr. 2001!

 

Thank you for your clarification.

 

I raised an issue with the development team to clarify how to achieve this, REVIT-92319 [API: FilteredElementCollector misses detail items -- 11829955].

 

They took a look at it and closed it again as 'works as expected', because the BoundingBoxIntersectsFilter is intended for use with a model geometry bounding box.

 

A detail item only has a view specific geometry bounding box, so it fails to filter them.

 

The workaround is to retrieve the view specific bounding box and use Outline.Intersects to perform the equivalent check, e.g., like this:

 

  var b1 = detailItem.get_BoundingBox(this.ActiveView);
  XYZ min = new XYZ();
  XYZ max = new XYZ(1.969,0.656,0);
  var outline = new Outline(min,max);
  var outlineOfDetailItem = new Outline(b1.Min, b1.Max);
  outline.Intersects(outlineOfDetailItem , 0.00001);

 

I published this solution on The Building Coder as well for future reference:

 

http://thebuildingcoder.typepad.com/blog/2016/06/filtering-for-view-specific-elements.html

 

Cheers,

 

Jeremy


Viewing all articles
Browse latest Browse all 66662

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>