Bounding Box Intersects - Tag vs Pipe

Hello to All,
I did try to find an answer to my question, but I did not find it.

I’m trying to create a Dynamo script which will mark all tags (or pipes) which are in clash (looking from the Floor Plan).

I manage to create a bounding box for the tags and to be sure I did change the Z coordinate of the pipes to a value 0. Used BoundingBox.Intersects block but the result is not logic. You can see that in the project that 5 of 9 elements clash with the pipes, but the block report just one collision… Do you have any idea why BoundingBox.Intersects gives me false report?

Hence, I’m a new user, I can not upload files… You can see my script and images at link:

Thank you in advance for the help.

A pipe is a 3d item, a tag is a 2d item.
oneside_a4.pdf (624.2 KB)

@Marcel_Rijsmus, Thank you for a quickly response. I’m aware of that, that is why I took location of the tag (point coordinates), built an rectangle (cs from the points, custom length and width) and then those rectangles, than curve to surface and finally geometry to bounding box. Probably I have a couple extra steps but in the Revit I can see that bounding boxes are on the perfect place.

In the other hand I wanted to be sure that bounding boxes from pipe be on the same vertical elevation that is why I change all pipe point to zero…

Please take a look to the script, all up to intercept block seem perfectly logic but the result is not logic…

Thanks again for help.

Hi @nenad.kovacevicUJ7NU,

I think you’re on the right path. Did you try to extrude the surface you are intersecting into a solid?

Python to get the TagHeadPosition:

import clr

from Autodesk.DesignScript.Geometry import *

#Import the Revit API
import Autodesk
from Autodesk.Revit.DB import *

#Import DocumentManager and TransactionManager
import RevitServices
from RevitServices.Persistence import DocumentManager

#Import ToDSType(bool) extensions method
import Revit

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

#---###Start scripting here:###---#
tags = UnwrapElement(IN[0])
pos = []

for i in tags:

OUT = pos

Good luck :slight_smile:

1 Like

Thank you very much for the help. I did try with solids but I did not know which block to use in order to compare if there is an intersect. I did also had idea to somehow import those solids into the Revit and to run Interference check there but that seem to be very complicate.

Thank you again for the help. :wink:

1 Like

Hey Martin.
I’m a Dynamo enthusiast and a complete python noob. I tried to copy the python code from your post (see image) but I got an “unexpected indent” error. I literally copied your code. Do you know where the error could be comming from? Thank you in advance if you’re willing to spend a time on replying!!

Hi @sivin.sivov,

Try copy+pasting it again.

The entire code had an additional indent for some reason.

Much appreciated man!

1 Like