mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 16:43:00 +00:00
aggregate.unassign_object - support batching #4474
This commit is contained in:
@@ -492,7 +492,7 @@ class UnassignStructuralLoadCase(bpy.types.Operator, tool.Ifc.Operator):
|
||||
self.file,
|
||||
**{
|
||||
"relating_object": self.file.by_id(self.work_plan),
|
||||
"product": self.file.by_id(self.load_case),
|
||||
"products": [self.file.by_id(self.load_case)],
|
||||
},
|
||||
)
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -45,7 +45,7 @@ def unassign_object(ifc, aggregate, collector, relating_obj=None, related_obj=No
|
||||
if related_element:
|
||||
relating_obj = ifc.get_object(relating_element)
|
||||
if relating_obj:
|
||||
ifc.run("aggregate.unassign_object", product=related_element)
|
||||
ifc.run("aggregate.unassign_object", products=[related_element])
|
||||
if container:
|
||||
ifc.run("spatial.assign_container", products=[related_element], relating_structure=container)
|
||||
collector.assign(relating_obj)
|
||||
|
||||
@@ -65,7 +65,7 @@ def assign_work_schedule(ifc, work_plan=None, work_schedule=None):
|
||||
|
||||
|
||||
def unassign_work_schedule(ifc, work_schedule=None):
|
||||
ifc.run("aggregate.unassign_object", product=work_schedule)
|
||||
ifc.run("aggregate.unassign_object", products=[work_schedule])
|
||||
|
||||
|
||||
def enable_editing_work_schedule(sequence, work_schedule=None):
|
||||
|
||||
@@ -54,7 +54,7 @@ class TestUnassignObject:
|
||||
ifc.get_entity("related_obj").should_be_called().will_return("element")
|
||||
aggregate.get_container("element").should_be_called().will_return("container")
|
||||
ifc.run("spatial.assign_container", products=["element"], relating_structure="container").should_be_called()
|
||||
ifc.run("aggregate.unassign_object", product="element").should_be_called().will_return("rel")
|
||||
ifc.run("aggregate.unassign_object", products=["element"]).should_be_called()
|
||||
collector.assign("relating_obj").should_be_called()
|
||||
collector.assign("related_obj").should_be_called()
|
||||
subject.unassign_object(ifc, aggregate, collector, relating_obj="relating_obj", related_obj="related_obj")
|
||||
|
||||
Reference in New Issue
Block a user