diff --git a/src/blenderbim/blenderbim/bim/module/cost/ui.py b/src/blenderbim/blenderbim/bim/module/cost/ui.py index 8f3b42598d..a2a0a0d3c8 100644 --- a/src/blenderbim/blenderbim/bim/module/cost/ui.py +++ b/src/blenderbim/blenderbim/bim/module/cost/ui.py @@ -109,7 +109,7 @@ class BIM_PT_cost_schedules(Panel): value = quantity[[k for k in quantity.keys() if "Value" in k][0]] row = self.layout.row(align=True) row.label(text=quantity["Name"]) - row.label(text=str(value)) + row.label(text="{0:.2f}".format(value)) if self.props.active_cost_item_quantity_id and self.props.active_cost_item_quantity_id == quantity_id: op = row.operator("bim.edit_cost_item_quantity", text="", icon="CHECKMARK") op.physical_quantity = quantity_id @@ -262,12 +262,12 @@ class BIM_UL_cost_items(UIList): op = row.operator("bim.enable_editing_cost_item_quantities", text="", icon="PROPERTIES") op.cost_item = item.ifc_definition_id - row.label(text=str("{0:.2f}".format(cost_item["TotalCostQuantity"])) + " (M3)") + row.label(text="{0:.2f}".format(cost_item["TotalCostQuantity"]) + " (M3)") op = row.operator("bim.enable_editing_cost_item_values", text="", icon="DISC") op.cost_item = item.ifc_definition_id - row.label(text=str("{0:.2f}".format(cost_item["TotalAppliedValue"]))) - row.label(text=str("{0:.2f}".format(cost_item["TotalCostValue"])), icon="CON_TRANSLIKE") + row.label(text="{0:.2f}".format(cost_item["TotalAppliedValue"])) + row.label(text="{0:.2f}".format(cost_item["TotalCostValue"]), icon="CON_TRANSLIKE") if context.active_object: oprops = context.active_object.BIMObjectProperties diff --git a/src/blenderbim/blenderbim/bim/module/group/__init__.py b/src/blenderbim/blenderbim/bim/module/group/__init__.py index b15d35a929..d8871b4131 100644 --- a/src/blenderbim/blenderbim/bim/module/group/__init__.py +++ b/src/blenderbim/blenderbim/bim/module/group/__init__.py @@ -11,6 +11,7 @@ classes = ( operator.UnassignGroup, operator.EnableEditingGroup, operator.DisableEditingGroup, + operator.SelectGroupProducts, prop.Group, prop.BIMGroupProperties, ui.BIM_PT_groups, diff --git a/src/blenderbim/blenderbim/bim/module/group/operator.py b/src/blenderbim/blenderbim/bim/module/group/operator.py index 6c4277aa40..bb75e5eb3d 100644 --- a/src/blenderbim/blenderbim/bim/module/group/operator.py +++ b/src/blenderbim/blenderbim/bim/module/group/operator.py @@ -152,3 +152,20 @@ class UnassignGroup(bpy.types.Operator): ) Data.load(IfcStore.get_file()) return {"FINISHED"} + + +class SelectGroupProducts(bpy.types.Operator): + bl_idname = "bim.select_group_products" + bl_label = "Select Group Products" + group: bpy.props.IntProperty() + + def execute(self, context): + self.file = IfcStore.get_file() + for obj in bpy.context.visible_objects: + obj.select_set(False) + if not obj.BIMObjectProperties.ifc_definition_id: + continue + product_groups = Data.products.get(obj.BIMObjectProperties.ifc_definition_id, []) + if self.group in product_groups: + obj.select_set(True) + return {"FINISHED"} diff --git a/src/blenderbim/blenderbim/bim/module/group/ui.py b/src/blenderbim/blenderbim/bim/module/group/ui.py index 21731dc0d0..a0f1a09125 100644 --- a/src/blenderbim/blenderbim/bim/module/group/ui.py +++ b/src/blenderbim/blenderbim/bim/module/group/ui.py @@ -69,11 +69,17 @@ class BIM_UL_groups(UIList): op.group = item.ifc_definition_id if context.scene.BIMGroupProperties.active_group_id == item.ifc_definition_id: + op = row.operator("bim.select_group_products", text="", icon="RESTRICT_SELECT_OFF") + op.group = item.ifc_definition_id row.operator("bim.edit_group", text="", icon="CHECKMARK") - row.operator("bim.disable_editing_group", text="", icon="X") + row.operator("bim.disable_editing_group", text="", icon="CANCEL") elif context.scene.BIMGroupProperties.active_group_id: + op = row.operator("bim.select_group_products", text="", icon="RESTRICT_SELECT_OFF") + op.group = item.ifc_definition_id row.operator("bim.remove_group", text="", icon="X").group = item.ifc_definition_id else: + op = row.operator("bim.select_group_products", text="", icon="RESTRICT_SELECT_OFF") + op.group = item.ifc_definition_id op = row.operator("bim.enable_editing_group", text="", icon="GREASEPENCIL") op.group = item.ifc_definition_id row.operator("bim.remove_group", text="", icon="X").group = item.ifc_definition_id diff --git a/src/blenderbim/blenderbim/bim/module/qto/operator.py b/src/blenderbim/blenderbim/bim/module/qto/operator.py index 210ac1240c..90911a67e3 100644 --- a/src/blenderbim/blenderbim/bim/module/qto/operator.py +++ b/src/blenderbim/blenderbim/bim/module/qto/operator.py @@ -90,6 +90,7 @@ class QuantifyObjects(bpy.types.Operator): result = helper.calculate_volume(obj) if not result: continue + result = round(result, 3) qto = ifcopenshell.api.run( "pset.add_qto", self.file,