mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Fix #2828. Bug where existing "TOP" connections were not removed if you tried to extend to a new slab / roof. Allow generic "top" connections to any LAYER3 element.
This commit is contained in:
@@ -108,12 +108,18 @@ class JoinWall(bpy.types.Operator, tool.Ifc.Operator):
|
||||
return {"FINISHED"}
|
||||
if self.join_type == "T":
|
||||
elements = [tool.Ifc.get_entity(o) for o in context.selected_objects]
|
||||
targets = [e for e in elements if e and e.is_a() in ("IfcSlab", "IfcSlabStandardCase", "IfcRoof")]
|
||||
if targets:
|
||||
target = tool.Ifc.get_object(targets[0])
|
||||
for element in elements:
|
||||
if tool.Model.get_usage_type(element) == "LAYER2":
|
||||
joiner.join_Z(tool.Ifc.get_object(element), target)
|
||||
layer2_elements = []
|
||||
layer3_elements = []
|
||||
for element in elements:
|
||||
usage = tool.Model.get_usage_type(element)
|
||||
if usage == "LAYER2":
|
||||
layer2_elements.append(element)
|
||||
elif usage == "LAYER3":
|
||||
layer3_elements.append(element)
|
||||
if layer3_elements:
|
||||
target = tool.Ifc.get_object(layer3_elements[0])
|
||||
for element in layer2_elements:
|
||||
joiner.join_Z(tool.Ifc.get_object(element), target)
|
||||
else:
|
||||
for obj in selected_objs:
|
||||
if obj == context.active_object:
|
||||
@@ -928,6 +934,15 @@ class DumbWallJoiner:
|
||||
element1 = tool.Ifc.get_entity(wall1)
|
||||
element2 = tool.Ifc.get_entity(slab2)
|
||||
|
||||
for rel in element1.ConnectedFrom:
|
||||
if rel.is_a() == "IfcRelConnectsElements" and rel.Description == "TOP":
|
||||
ifcopenshell.api.run(
|
||||
"geometry.disconnect_element",
|
||||
tool.Ifc.get(),
|
||||
relating_element=rel.RelatingElement,
|
||||
related_element=element1,
|
||||
)
|
||||
|
||||
ifcopenshell.api.run(
|
||||
"geometry.connect_element",
|
||||
tool.Ifc.get(),
|
||||
|
||||
Reference in New Issue
Block a user