mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Fix #6575. Regression in moving aggregates.
This commit is contained in:
@@ -3071,20 +3071,21 @@ class OverrideMove(bpy.types.Operator):
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if not element or not element.is_a("IfcElement"):
|
||||
continue
|
||||
parts = ifcopenshell.util.element.get_parts(element)
|
||||
if parts:
|
||||
|
||||
if parts := ifcopenshell.util.element.get_parts(element):
|
||||
aggregates_to_move.append(tool.Ifc.get_object(element))
|
||||
aggregates_to_move.extend(list(tool.Aggregate.get_parts_recursively(element)))
|
||||
continue
|
||||
|
||||
# Controls the aggregate level it should consider to move
|
||||
aggregates = tool.Aggregate.get_aggregates_recursively(element)
|
||||
aggregate = aggregates[-1]
|
||||
if props.in_aggregate_mode:
|
||||
current_aggregate_index = aggregates.index(tool.Ifc.get_entity(props.editing_aggregate))
|
||||
aggregate = aggregates[current_aggregate_index - 1]
|
||||
if tool.Ifc.get_entity(props.editing_aggregate) == aggregates[0]:
|
||||
aggregate = aggregates[0]
|
||||
aggregate = None
|
||||
if aggregates := tool.Aggregate.get_aggregates_recursively(element):
|
||||
aggregate = aggregates[-1]
|
||||
if props.in_aggregate_mode:
|
||||
current_aggregate_index = aggregates.index(tool.Ifc.get_entity(props.editing_aggregate))
|
||||
aggregate = aggregates[current_aggregate_index - 1]
|
||||
if tool.Ifc.get_entity(props.editing_aggregate) == aggregates[0]:
|
||||
aggregate = aggregates[0]
|
||||
|
||||
if not parts and props.in_aggregate_mode and aggregate == tool.Ifc.get_entity(props.editing_aggregate):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user