From 06dcea26fce85fdf3ca1a93cd26cbbb7a97f5586 Mon Sep 17 00:00:00 2001 From: Michal Pekacki Date: Wed, 19 Aug 2026 12:08:17 +0200 Subject: [PATCH] added support for direct shape --- Revit_Core_Engine/Query/LocationPoint.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Revit_Core_Engine/Query/LocationPoint.cs b/Revit_Core_Engine/Query/LocationPoint.cs index f818a1ab9..8460a93f5 100644 --- a/Revit_Core_Engine/Query/LocationPoint.cs +++ b/Revit_Core_Engine/Query/LocationPoint.cs @@ -70,7 +70,12 @@ public static XYZ LocationPoint(this Element element, bool useRoomCalculationPoi // Fallback to bounding box center if (locationPoint == null) { - BoundingBoxXYZ bbox = element.PhysicalBounds() ?? element.get_BoundingBox(null); + BoundingBoxXYZ bbox = null; + if (element is DirectShape) + bbox = element.get_BoundingBox(null); + else + bbox = element.PhysicalBounds() ?? element.get_BoundingBox(null); + if (bbox != null) locationPoint = (bbox.Max + bbox.Min) / 2; }