mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Fix #4740. Bug where building element proxies didn't work for the auto calculate all button.
This commit is contained in:
@@ -170,6 +170,7 @@ class QuantifyObjects(bpy.types.Operator):
|
|||||||
ifcopenshell.api.run("pset.edit_qto", self.file, qto=qto, properties={props.prop_name: result})
|
ifcopenshell.api.run("pset.edit_qto", self.file, qto=qto, properties={props.prop_name: result})
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class AssignBaseQto(bpy.types.Operator, tool.Ifc.Operator):
|
class AssignBaseQto(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.assign_objects_base_qto"
|
bl_idname = "bim.assign_objects_base_qto"
|
||||||
bl_label = "Assign IFC Object Quantity Set"
|
bl_label = "Assign IFC Object Quantity Set"
|
||||||
@@ -181,9 +182,10 @@ class AssignBaseQto(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
return tool.Ifc.get() and context.selected_objects
|
return tool.Ifc.get() and context.selected_objects
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
core.assign_objects_base_qto(tool.Ifc, tool.Qto, selected_objects = context.selected_objects)
|
core.assign_objects_base_qto(tool.Ifc, tool.Qto, selected_objects=context.selected_objects)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class CalculateAllQuantities(bpy.types.Operator, tool.Ifc.Operator):
|
class CalculateAllQuantities(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.calculate_all_quantities"
|
bl_idname = "bim.calculate_all_quantities"
|
||||||
bl_label = "Calculate All Quantities"
|
bl_label = "Calculate All Quantities"
|
||||||
@@ -195,5 +197,7 @@ class CalculateAllQuantities(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
return tool.Ifc.get() and context.selected_objects
|
return tool.Ifc.get() and context.selected_objects
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
core.calculate_objects_base_quantities(tool.Ifc, tool.Cost, tool.Qto, QtoCalculator(), selected_objects = context.selected_objects)
|
core.calculate_objects_base_quantities(
|
||||||
|
tool.Ifc, tool.Cost, tool.Qto, QtoCalculator(), selected_objects=context.selected_objects
|
||||||
|
)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ class Qto(blenderbim.core.tool.Qto):
|
|||||||
applicable_qto_names = blenderbim.bim.schema.ifc.psetqto.get_applicable_names(
|
applicable_qto_names = blenderbim.bim.schema.ifc.psetqto.get_applicable_names(
|
||||||
product.is_a(), ifcopenshell.util.element.get_predefined_type(product), qto_only=True
|
product.is_a(), ifcopenshell.util.element.get_predefined_type(product), qto_only=True
|
||||||
)
|
)
|
||||||
return next((qto_name for qto_name in applicable_qto_names if "Qto_" in qto_name and "Base" in qto_name), None)
|
# See https://github.com/buildingSMART/IFC4.3.x-development/issues/851 for anomalies in Qto naming
|
||||||
|
return next((qto_name for qto_name in applicable_qto_names if "Qto_" in qto_name), None)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_new_calculated_quantity(cls, qto_name: str, quantity_name: str, obj: bpy.types.Object) -> float:
|
def get_new_calculated_quantity(cls, qto_name: str, quantity_name: str, obj: bpy.types.Object) -> float:
|
||||||
|
|||||||
Reference in New Issue
Block a user