Skip to content

Commit

Permalink
bulk assignment of objects to an aggregate.
Browse files Browse the repository at this point in the history
  • Loading branch information
theoryshaw committed May 23, 2023
1 parent 629aff1 commit 535e974
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/blenderbim/blenderbim/bim/module/aggregate/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ class BIM_OT_assign_object(bpy.types.Operator, Operator):
related_object: bpy.props.IntProperty()

def _execute(self, context):
core.assign_object(
tool.Ifc,
tool.Aggregate,
tool.Collector,
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)),
)
for obj in bpy.context.selected_objects:
element = tool.Ifc.get_entity(obj)
if not element:
continue
core.assign_object(
tool.Ifc,
tool.Aggregate,
tool.Collector,
relating_obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.relating_object)),
related_obj=obj,
)


class BIM_OT_unassign_object(bpy.types.Operator, Operator):
Expand Down

0 comments on commit 535e974

Please sign in to comment.