Python - BoundingBox property returns indexer. How to get Element.BoundingBox?

I am trying to get the bounding box of an element so I can get the middle point.

I thought this would be the Element Property

Using this on a Room Element, python returns a
from which I can get the Max or Min points.

import clr

# import Revit Services 
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

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

doc = DocumentManager.Instance.CurrentDBDocument
bbox = rooms[0].BoundingBox



This post on stackoverflow includes a function get_BoundingBox, which is not in the Revit API library. I have not seen an ‘_’ used in function names so suspect this is part of pyRevit?.

el_bb = el_ID.get_BoundingBox(doc.ActiveView)

I would like to be able to get the bounding box of the element using Python.

Thank you.

Does the get_BoundingBox() not work? I believe that Syntax is correct for python.

Thanks Sean, I managed to get get_BoundingBox to work:

def GetCenterPoint(ele):
	bBox = ele.get_BoundingBox(None)
	return (bBox.Max + bBox.Min) / 2

I was using the function in a larger script… I think my issue is related to this post:

Where can I find documentation on the python Syntax for the API?.

1 Like