From e23142d01a570c04fd12e4812b215d77e85fb2df Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Thu, 9 Jul 2026 07:27:56 +0300 Subject: [PATCH] Fix #7331: derive cost item quantities from IfcSpace base quantities assign_cost_item_quantity skipped every IfcSpatialElement, which also swallowed IfcSpace. Spaces are legitimate quantifiable objects, so their Qto_SpaceBaseQuantities (for example GrossFloorArea) were never picked up and count based cost items fell back to 0. Keep skipping spatial containers (site, building, storey) but allow IfcSpace. Co-Authored-By: Claude Opus 4.8 --- .../ifcopenshell/api/cost/assign_cost_item_quantity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py b/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py index c699bb1ebb..7ddfaa2dd0 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py +++ b/src/ifcopenshell-python/ifcopenshell/api/cost/assign_cost_item_quantity.py @@ -137,7 +137,7 @@ class Usecase: if self.prop_name or formula: self.quantities = set(cost_item.CostQuantities or []) for product in products: - if product.is_a("IfcSpatialElement"): + if product.is_a("IfcSpatialElement") and not product.is_a("IfcSpace"): continue ifcopenshell.api.control.assign_control( self.file,