How to get the elements inside a boundingbox?

Hi @Einar_Raknes ,
that’s really awesome, but can we modify this python node to let it give the elements that intersects with the bounding box not only the elements that are completely inside it?

thank you

Sure, change

filter = BoundingBoxIsInsideFilter(outline)

to:

filter = BoundingBoxIntersectsFilter(outline)

3 Likes

ohh thank you that’s what I want,

any links to get familiar with such functions and python?

Yes, the complete Revit API documentation is available here:

http://www.revitapidocs.com/2017/eb8735d7-28fc-379d-9de9-1e02326851f5.htm#exampleToggle

Thank you :slight_smile:

Great post Einar_Raknes. This is defiantly a nugget of gold I have found, thank you. I am a new Dynamo user and not that familiar with code writing. I have been trying to modify your code to collect the elements within the active model and linked models as well. Unfortunately I am not succeeding. I would greatly appreciate any help you could offer in helping me achieve my goal.

Hello, im new user dynamo
Now i got 1 case. I have 1 element get bounding box and 1 element list. I want to find the elements intersection with bounding box.
Example: Bounding box
List Element ( A, B,C)…
===> Find Who element in List Element if it intersection Bounding box.
Thanks
Sr English so bad

Hello to all,

is there a reason, why “text notes” are not shown up with the python script ?

Start a new topic we can’t have 2 solutions in one topic.

Legend!

hi thanks to your methord,awesome job

and i wonder if we can “Access Elements Through all Linked File” by Python script

or can you update your code and made it can access the linked elements

many thanks

You could use BimorphNodes for this and adopt the workflow shown below. It also deals with limitations associated with linked elements (explained in the article here if you want to learn more):

1 Like

thanks
i’ll try it later :slight_smile:

Hey, I get this message when trying to use Einar code (dynamo 2.0.3)

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 28, in
File “”, line 23, in ToRevit
AttributeError: ‘NoneType’ object has no attribute ‘ToRevitType’

@Einar_Raknes
Is it possible to feed a list of Views?
Also, is it possible to get the Areas in the Scopebox (Boundingbox)?

You can skip the view-filter all together, and collect alle elements in the enitre model, just remove the second argument like this:
collector = FilteredElementCollector(doc).WherePasses(filter)

I saw all the posts and reply in that post it was a great but i have very simple stupid question if we are dealing with non geometric or non regular boundary of rooms like in the snapshot i think Bounding Box is not reading it properly and it will start to combined some areas together if someone can help on this

This Example make it more clear i attached, the highlighted Air Terminal should be part of Room 3 but when i created the Bounding Box based on the Room or even any other way in the script it become part of Room 1 which is wrong.

I think you should get geometry room and check intersection to filter element Air Terminal.

I did already i get the room Geometry and convert to bounding box then tried to get the intersection but the result as i mentioned