mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 08:33:10 +00:00
You can now remove structural connection conditions + minor mods
This commit is contained in:
@@ -24,9 +24,6 @@ class EnableEditingStructuralConnectionCondition(bpy.types.Operator):
|
||||
oprops = obj.BIMObjectProperties
|
||||
props = obj.BIMStructuralProperties
|
||||
applied_condition_id = Data.connects_structural_members[self.connects_structural_member]["AppliedCondition"]
|
||||
if applied_condition_id:
|
||||
bpy.ops.bim.enable_editing_structural_boundary_condition(boundary_condition=applied_condition_id)
|
||||
|
||||
props.active_connects_structural_member = self.connects_structural_member
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -45,8 +42,15 @@ class DisableEditingStructuralConnectionCondition(bpy.types.Operator):
|
||||
class RemoveStructuralConnectionCondition(bpy.types.Operator):
|
||||
bl_idname = "bim.remove_structural_connection_condition"
|
||||
bl_label = "Remove Structural Connection Condition"
|
||||
connects_structural_member: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
file = IfcStore.get_file()
|
||||
relation = file.by_id(self.connects_structural_member)
|
||||
connection = relation.RelatedStructuralConnection
|
||||
ifcopenshell.api.run("structural.remove_structural_connection_condition", file, **{"relation": relation})
|
||||
|
||||
Data.load(IfcStore.get_file(), connection.id())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -68,14 +72,17 @@ class AddStructuralBoundaryCondition(bpy.types.Operator):
|
||||
|
||||
class RemoveStructuralBoundaryCondition(bpy.types.Operator):
|
||||
bl_idname = "bim.remove_structural_boundary_condition"
|
||||
bl_label = "Enable Editing Structural Boundary Condition"
|
||||
bl_label = "Remove Structural Boundary Condition"
|
||||
connection: bpy.props.IntProperty()
|
||||
|
||||
def execute(self, context):
|
||||
obj = context.active_object
|
||||
file = IfcStore.get_file()
|
||||
connection = file.by_id(obj.BIMObjectProperties.ifc_definition_id)
|
||||
connection = file.by_id(self.connection)
|
||||
ifcopenshell.api.run("structural.remove_structural_boundary_condition", file, **{"connection": connection})
|
||||
Data.load(IfcStore.get_file(), connection.id())
|
||||
if connection.is_a("IfcRelConnectsStructuralMember"):
|
||||
Data.load(IfcStore.get_file(), connection.RelatedStructuralConnection.id())
|
||||
else:
|
||||
Data.load(IfcStore.get_file(), connection.id())
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@ def draw_boundary_condition_ui(layout, boundary_condition_id, connection_id, pro
|
||||
row.operator("bim.disable_editing_structural_boundary_condition", text="", icon="X")
|
||||
elif props.active_boundary_condition and props.active_boundary_condition != boundary_condition_id:
|
||||
row.label(text=data["type"], icon="CON_TRACKTO")
|
||||
row.operator("bim.remove_structural_boundary_condition", text="", icon="X")
|
||||
row.operator("bim.remove_structural_boundary_condition", text="", icon="X").connection = connection_id
|
||||
else:
|
||||
row.label(text=data["type"], icon="CON_TRACKTO")
|
||||
op = row.operator("bim.enable_editing_structural_boundary_condition", text="", icon="GREASEPENCIL")
|
||||
op.boundary_condition = data["id"]
|
||||
row.operator("bim.remove_structural_boundary_condition", text="", icon="X")
|
||||
row.operator("bim.remove_structural_boundary_condition", text="", icon="X").connection = connection_id
|
||||
|
||||
if props.active_boundary_condition and props.active_boundary_condition == boundary_condition_id:
|
||||
draw_boundary_condition_editable_ui(layout, props)
|
||||
@@ -124,14 +124,16 @@ class BIM_PT_connected_structural_members(Panel):
|
||||
row.label(text=f"To Member #{rel['RelatingStructuralMember']}")
|
||||
if self.props.active_connects_structural_member and self.props.active_connects_structural_member == rel_id:
|
||||
row.operator("bim.disable_editing_structural_connection_condition", text="", icon="CHECKMARK")
|
||||
row.operator("bim.disable_editing_structural_connection_condition", text="", icon="X")
|
||||
row.enabled = self.props.active_boundary_condition != rel["AppliedCondition"]
|
||||
self.draw_editable_ui(context, self.layout, rel)
|
||||
elif self.props.active_connects_structural_member:
|
||||
row.operator("bim.remove_structural_connection_condition", text="", icon="X")
|
||||
op = row.operator("bim.remove_structural_connection_condition", text="", icon="X")
|
||||
op.connects_structural_member = rel_id
|
||||
else:
|
||||
op = row.operator("bim.enable_editing_structural_connection_condition", text="", icon="GREASEPENCIL")
|
||||
op.connects_structural_member = rel_id
|
||||
row.operator("bim.remove_structural_connection_condition", text="", icon="X")
|
||||
op = row.operator("bim.remove_structural_connection_condition", text="", icon="X")
|
||||
op.connects_structural_member = rel_id
|
||||
|
||||
def draw_editable_ui(self, context, layout, data):
|
||||
box = layout.box()
|
||||
|
||||
Reference in New Issue
Block a user