Bounding Box not reporting correct coordinates


#1

I’m running into an issue where I can’t get the right min and max coordinates in Dynamo. I’m using a Python script such as the following:

for element in elements:
    bbox = element.BoundingBox[doc.GetElement(element.OwnerViewId)]
				
min = bbox.Min
max = bbox.Max

Whenever I use this same code in Revit Python Shell, I get two different numbers for the min and the max.
For example: In Dynamo I get (-2.2, 93, 0) and in RPS I get (-32.2, 93, 0)

Any reason for the discrepancy?

I feel like I am missing some sort of conversion in Dynamo? Has anyone else seen this issue?

Thanks,
Dan


#2

My guess: Units.

What value do you get from the OOTB bounding box method?


#3

Revit Python Shell: (33.131, -72.270, 0)
Dynamo Python: (53.357, -111.017, 0)
Dynamo OOTB Node: (53.857, -107.986, 0)

See attached image for script and nodes.

Not sure what’s causing the inconsistencies. Any ideas?


#4

Can you share a model and the dyn?


#5

Here is a super simple Revit file with a group on the Drafting View that I am using to try to test the bounding box as well as the dynamo file above.

Let me know if you can figure it out.

Thanks!

BoundingBox.dyn (4.0 KB)
BoundingBox.rvt (700 KB)