DoesIntersect Python problem

Hello !

I’m facing a problem I can’t understand and solve…

I’m trying to get the openings of my Revit Model and to sort them following wich wall they are intersecting. I built a Dynamo program to try to check if a window is intersecting a wall and it perfectly works (see image below).

But I want to make it in a Python script so I can make the check for a list of walls and a list of openings. I wrote the code below, using the same functions as in the Dynamo program :

But I’m getting this error and I don’t understand what’s wrong…

Thank you for your help ! :slight_smile:

I think you should first try to unwrap the elements that are Revit elements, for example: the windows should be loaded into the script list this:
windows = UnwrapElement(IN[1])

You can find out more here: https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration

Thank you for your answer !

I noticed I forgot some parenthesis after BoundingBox(), ToCuboid(), etc so I added it and my code is now :

I’m now getting an other error :

Or, when I “Unwrap” my windows like you explained, I’m getting :

Is there something I misunderstood ? :confused:

Sorry, it’s not my field of expertise but I think you’re mistaking the Revit API with the Dynamo API.
First of to get the boundingbox of an element with the Revit API you need query it by using it as property, so in this case you would need:

bb = win.BoundingBox

After that the ‘bb’ instance is a Revit boundingbox and not a Dynamo boundingbox, so using ToCuboid on it won’t work. You’ll need to take a look at http://www.revitapidocs.com/2016/3c452286-57b1-40e2-2795-c90bff1fcec2.htm where you can find the members of the boundingbox.

For more info on using the Revit API to do clash detection you could take a look at these nodes from Bakery:

1 Like

Hi @ansobr

There is a custom node from clockwork package called “Element.Inserts” that will give you openings.