bulk assignment of objects to an aggregate.

This commit is contained in:
Ryan Schultz
2023-05-22 22:06:08 -05:00
parent 629aff1e50
commit 535e974cc3
@@ -43,12 +43,16 @@ class BIM_OT_assign_object(bpy.types.Operator, Operator):
related_object: bpy.props.IntProperty() related_object: bpy.props.IntProperty()
def _execute(self, context): def _execute(self, context):
for obj in bpy.context.selected_objects:
element = tool.Ifc.get_entity(obj)
if not element:
continue
core.assign_object( core.assign_object(
tool.Ifc, tool.Ifc,
tool.Aggregate, tool.Aggregate,
tool.Collector, tool.Collector,
relating_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.relating_object)), relating_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.relating_object)),
related_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.related_object)), related_obj=obj,
) )