diff --git a/src/blenderbim/blenderbim/bim/module/model/data.py b/src/blenderbim/blenderbim/bim/module/model/data.py index 66a4ca1cf5..58e54faffa 100644 --- a/src/blenderbim/blenderbim/bim/module/model/data.py +++ b/src/blenderbim/blenderbim/bim/module/model/data.py @@ -67,6 +67,7 @@ class AuthoringData: cls.data["active_material_usage"] = cls.active_material_usage() cls.data["active_representation_type"] = cls.active_representation_type() cls.data["boundary_class"] = cls.boundary_class() + cls.data["selected_material_usages"] = cls.selected_material_usages() @classmethod def boundary_class(cls): @@ -238,6 +239,23 @@ class AuthoringData: return [(str(e.id()), e.Name or "Unnamed", e.Description or "") for e in results] return [] + @classmethod + def selected_material_usages(cls): + selected_usages = {} + for obj in bpy.context.selected_objects: + element = tool.Ifc.get_entity(obj) + if not element: + continue + usage = tool.Model.get_usage_type(element) + if not usage: + representation = tool.Geometry.get_active_representation(obj) + if representation and representation.RepresentationType == "SweptSolid": + usage = "SWEPTSOLID" + else: + continue + selected_usages.setdefault(usage, []).append(obj) + return selected_usages + class ArrayData: data = {} diff --git a/src/blenderbim/blenderbim/bim/module/model/workspace.py b/src/blenderbim/blenderbim/bim/module/model/workspace.py index 2b7bface16..26f5631947 100644 --- a/src/blenderbim/blenderbim/bim/module/model/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/model/workspace.py @@ -176,7 +176,11 @@ class BimToolUI: row.operator("bim.join_wall", icon="X", text="").join_type = "" elif AuthoringData.data["active_material_usage"] == "LAYER3": - add_layout_hotkey_operator(cls.layout, "Edit Profile", "S_E", "") + + if len(context.selected_objects) == 1: + add_layout_hotkey_operator(cls.layout, "Edit Profile", "S_E", "") + elif "LAYER2" in AuthoringData.data["selected_material_usages"]: + add_layout_hotkey_operator(cls.layout, "Extend Wall To Slab", "S_E", "") row = cls.layout.row(align=True) row.prop(data=cls.props, property="x_angle", text="X Angle")