Exposed some MEP operators in BIM Tool UI

https://i.imgur.com/U61QqlQ.png
This commit is contained in:
Andrej730
2023-09-19 16:58:12 +05:00
parent 0c57f8ea39
commit ebd02f20db
@@ -347,8 +347,15 @@ class BimToolUI:
"IfcDuctSegment", "IfcDuctSegment",
"IfcPipeSegment", "IfcPipeSegment",
): ):
add_layout_hotkey_operator(cls.layout, "Extend", "S_E", "")
add_layout_hotkey_operator(cls.layout, "Add Fitting", "S_F", "") add_layout_hotkey_operator(cls.layout, "Add Fitting", "S_F", "")
add_layout_hotkey_operator(
cls.layout, "Regen MEP", "S_G", bpy.ops.bim.regenerate_distribution_element.__doc__
)
if context.region.type != "TOOL_HEADER":
cls.layout.operator("bim.mep_add_bend")
cls.layout.operator("bim.mep_add_transition")
cls.layout.operator("bim.mep_add_obstruction")
cls.layout.operator("bim.mep_connect_elements")
else: else:
add_layout_hotkey_operator(cls.layout, "Edit Axis", "A_E", "") add_layout_hotkey_operator(cls.layout, "Edit Axis", "A_E", "")
add_layout_hotkey_operator(cls.layout, "Butt", "S_T", "") add_layout_hotkey_operator(cls.layout, "Butt", "S_T", "")
@@ -667,6 +674,14 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
if self.active_material_usage == "LAYER2": if self.active_material_usage == "LAYER2":
bpy.ops.bim.recalculate_wall() bpy.ops.bim.recalculate_wall()
elif self.active_material_usage == "PROFILE": elif self.active_material_usage == "PROFILE":
if self.active_class in (
"IfcCableCarrierSegment",
"IfcCableSegment",
"IfcDuctSegment",
"IfcPipeSegment",
):
bpy.ops.bim.regenerate_distribution_element()
else:
bpy.ops.bim.recalculate_profile() bpy.ops.bim.recalculate_profile()
elif self.active_class in ("IfcWindow", "IfcWindowStandardCase", "IfcDoor", "IfcDoorStandardCase"): elif self.active_class in ("IfcWindow", "IfcWindowStandardCase", "IfcDoor", "IfcDoorStandardCase"):
bpy.ops.bim.recalculate_fill() bpy.ops.bim.recalculate_fill()