Fix bug related to Linked Aggregates

This commit is contained in:
Bruno Perdigão
2024-07-17 15:45:10 -03:00
parent 0efa36940c
commit 798cc6069f
2 changed files with 6 additions and 4 deletions
@@ -304,7 +304,7 @@ class BIM_OT_break_link_to_other_aggregates(bpy.types.Operator, tool.Ifc.Operato
for part in parts:
pset = ifcopenshell.util.element.get_pset(part, "BBIM_Linked_Aggregate")
pset = tool.Ifc.get().by_id(pset["id"])
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), pset=pset)
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), product=part, pset=pset)
linked_aggregate_group = [
r.RelatingGroup
@@ -1000,7 +1000,8 @@ class OverrideDuplicateMove(bpy.types.Operator):
if r.is_a("IfcRelAssignsToGroup")
if "BBIM_Linked_Aggregate" in r.RelatingGroup.Name
]
tool.Ifc.run("group.unassign_group", group=linked_aggregate_group[0], products=[new[0]])
if linked_aggregate_group:
tool.Ifc.run("group.unassign_group", group=linked_aggregate_group[0], products=[new[0]])
class OverrideDuplicateMoveLinkedMacro(bpy.types.Macro):
@@ -1282,8 +1283,9 @@ class RefreshLinkedAggregate(bpy.types.Operator):
pset = ifcopenshell.util.element.get_pset(part, self.pset_name)
except:
continue
index = pset["Index"]
original_names[group][index] = tool.Ifc.get_object(part).name
if pset:
index = pset["Index"]
original_names[group][index] = tool.Ifc.get_object(part).name
return original_names