fix qto ui bug where objects with no assigned base qto doesn't allow to show the qto panel

This commit is contained in:
Massimo Fabbro
2023-04-01 08:56:51 +02:00
parent 86ed354a05
commit 3f2adc1e13
+2 -1
View File
@@ -157,10 +157,11 @@ class Qto(blenderbim.core.tool.Qto):
print(f"RELATING COST QUANTITY NAME: {relating_cost_item["quantity_name"]}")
...
"""
quantities = cls.get_base_qto(product).Quantities
model = tool.Ifc.get()
cost_items = model.by_type("IfcCostItem")
result = []
base_qto = cls.get_base_qto(product)
quantities = base_qto.Quantities if base_qto else []
for cost_item in cost_items:
cost_item_quantities = cost_item.CostQuantities if cost_item.CostQuantities is not None else []