Getting Elements from BoundingBoxXYZ

Getting Elements from BoundingBoxXYZ

Anonymous
Not applicable
646 Views
1 Reply
Message 1 of 2

Getting Elements from BoundingBoxXYZ

Anonymous
Not applicable

Hi!

I have some BoundingBox ang a want to get all Element inside this Box.

Any suggestions?

0 Likes
647 Views
1 Reply
Reply (1)
Message 2 of 2

matthew_taylor
Advisor
Advisor

Hi @Anonymous,

There are element filters for that:

Dim bb As DB.BoundingBoxXYZ = elem.BoundingBox(view)
If bb IsNot Nothing Then
            Dim min As DB.XYZ = bb.Min
            Dim max As DB.XYZ = bb.Max
            Dim outline As New DB.Outline(min,max)
            Dim bbfilter As New DB.BoundingBoxIsInsideFilter(outline)
            ' Don't use a view to construct the filter 
' as it won't return good results for some view types. ' will need to refine this function if we want only elements
' visible in the view. Dim collector As New DB.FilteredElementCollector(m_doc) collector.WherePasses(bbfilter) ...

I'm pretty sure those comments come from either @jeremytammik or someone on this site somewhere...

 


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?