mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Fix #5570 : Regen button now appears in the toolbar for windows and doors
This commit is contained in:
@@ -83,6 +83,7 @@ class AuthoringData:
|
||||
|
||||
# Only after .active_material_usage() and .active_class()
|
||||
cls.data["is_flippable_element"] = cls.is_flippable_element()
|
||||
cls.data["is_regenable_element"] = cls.is_regenable_element()
|
||||
|
||||
@classmethod
|
||||
def default_container(cls) -> str | None:
|
||||
@@ -171,6 +172,19 @@ class AuthoringData:
|
||||
"IfcDoorStandardCase",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def is_regenable_element(cls):
|
||||
if cls.data["active_material_usage"] in ("LAYER2", "PROFILE") and cls.data["active_class"] not in (
|
||||
"IfcCableCarrierSegment",
|
||||
"IfcCableSegment",
|
||||
"IfcDuctSegment",
|
||||
"IfcPipeSegment",
|
||||
):
|
||||
return True
|
||||
if cls.data["active_class"] in ("IfcWindow", "IfcWindowStandardCase", "IfcDoor", "IfcDoorStandardCase"):
|
||||
return True
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def has_visible_openings(cls):
|
||||
if active_object := tool.Blender.get_active_object():
|
||||
|
||||
@@ -771,24 +771,11 @@ class EditObjectUI:
|
||||
def draw_regen_operations(cls, row):
|
||||
custom_icon = custom_icon_previews.get("REGEN", custom_icon_previews["IFC"]).icon_id
|
||||
|
||||
if AuthoringData.data["active_material_usage"] == "LAYER2":
|
||||
if AuthoringData.data["is_regenable_element"]:
|
||||
op = row.operator("bim.hotkey", text="", icon_value=custom_icon)
|
||||
description = f"{bpy.ops.bim.recalculate_wall.__doc__}\n\nHotkey: S G"
|
||||
description = "Recalculate Element Geometry\nHotkey: S G"
|
||||
op.hotkey = "S_G"
|
||||
op.description = description.strip()
|
||||
elif AuthoringData.data["active_material_usage"] == "PROFILE":
|
||||
if AuthoringData.data["active_class"] in (
|
||||
"IfcCableCarrierSegment",
|
||||
"IfcCableSegment",
|
||||
"IfcDuctSegment",
|
||||
"IfcPipeSegment",
|
||||
):
|
||||
pass
|
||||
else:
|
||||
op = row.operator("bim.hotkey", text="", icon_value=custom_icon)
|
||||
description = f"{bpy.ops.bim.recalculate_profile.__doc__}\n\nHotkey: S G"
|
||||
op.hotkey = "S_G"
|
||||
op.description = description.strip()
|
||||
|
||||
if PortData.data["total_ports"] > 0:
|
||||
op = row.operator("bim.hotkey", text="", icon_value=custom_icon)
|
||||
|
||||
Reference in New Issue
Block a user