How to exclude the family origin from the bounding box?

Hello,

I have multiple large models with lots of generic model elements in them. I need to get the location of these generic model elements within my project. Currently I have a script that convert the elements to solids and uses the solids to determine the location. However, this makes the scripts really slow and prone to crashes.

I am now trying another approach that uses the bounding box of the elements. The center of the bounding box is all I need. The problem is that the bounding box also includes the insertion point of the generic models(which in this case is the Project basepoint, see picture).

Is there a way to exclude the family origin from the bounding box?
Does anyone have another suggestion for how to get the location of the element without using their geometries?

Thanks in advance!

try:
location= ((LocationPoint)element?.Location)?.Point;
it should give you the location of the element