mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
api: assign_group now expects product to be a list
* minor change to assign_group * api: assign_group now expects product: list
This commit is contained in:
@@ -43,6 +43,7 @@ class Usecase:
|
||||
)
|
||||
rel = self.settings["group"].IsGroupedBy[0]
|
||||
related_objects = set(rel.RelatedObjects) or set()
|
||||
related_objects.add(self.settings["product"])
|
||||
for obj in self.settings["product"]:
|
||||
related_objects.add(obj)
|
||||
rel.RelatedObjects = list(related_objects)
|
||||
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel})
|
||||
|
||||
@@ -1111,7 +1111,7 @@ class TestIdsAuthoring(unittest.TestCase):
|
||||
group = ifcopenshell.api.run("group.add_group", ifc)
|
||||
facet = ids.partOf.create(entity="IfcGroup")
|
||||
run("", facet=facet, inst=element, expected=False)
|
||||
ifcopenshell.api.run("group.assign_group", ifc, product=element, group=group)
|
||||
ifcopenshell.api.run("group.assign_group", ifc, product=[element], group=group)
|
||||
run("", facet=facet, inst=element, expected=True)
|
||||
|
||||
# An IfcGroup can be passed by subtypes
|
||||
@@ -1119,7 +1119,7 @@ class TestIdsAuthoring(unittest.TestCase):
|
||||
element = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcElementAssembly")
|
||||
group = ifc.createIfcInventory()
|
||||
facet = ids.partOf.create(entity="IfcGroup")
|
||||
ifcopenshell.api.run("group.assign_group", ifc, product=element, group=group)
|
||||
ifcopenshell.api.run("group.assign_group", ifc, product=[element], group=group)
|
||||
run("", facet=facet, inst=element, expected=True)
|
||||
|
||||
# An IfcSystem only checks that a system is assigned without any other logic
|
||||
|
||||
Reference in New Issue
Block a user