mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
typing
This commit is contained in:
@@ -3179,7 +3179,7 @@ class OverrideMove(bpy.types.Operator):
|
|||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
# Get filling objects
|
# Get filling objects
|
||||||
selection = []
|
selection: list[bpy.types.Object] = []
|
||||||
for obj in context.selected_objects:
|
for obj in context.selected_objects:
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if not element:
|
if not element:
|
||||||
@@ -3196,8 +3196,8 @@ class OverrideMove(bpy.types.Operator):
|
|||||||
|
|
||||||
# Get aggregates
|
# Get aggregates
|
||||||
props = tool.Aggregate.get_aggregate_props()
|
props = tool.Aggregate.get_aggregate_props()
|
||||||
not_editing_objs = [o.obj for o in props.not_editing_objects]
|
not_editing_objs = [obj for o in props.not_editing_objects if (obj := o.obj)]
|
||||||
aggregates_to_move = []
|
aggregates_to_move: list[bpy.types.Object] = []
|
||||||
for obj in context.selected_objects:
|
for obj in context.selected_objects:
|
||||||
self.new_active_obj = None
|
self.new_active_obj = None
|
||||||
if obj in not_editing_objs:
|
if obj in not_editing_objs:
|
||||||
@@ -3229,10 +3229,9 @@ class OverrideMove(bpy.types.Operator):
|
|||||||
if aggregate:
|
if aggregate:
|
||||||
aggregates_to_move.append(tool.Ifc.get_object(aggregate))
|
aggregates_to_move.append(tool.Ifc.get_object(aggregate))
|
||||||
obj.select_set(False)
|
obj.select_set(False)
|
||||||
aggregates_to_move = set(aggregates_to_move)
|
|
||||||
|
|
||||||
if aggregates_to_move:
|
if aggregates_to_move:
|
||||||
for obj in aggregates_to_move:
|
for obj in set(aggregates_to_move):
|
||||||
obj.select_set(True)
|
obj.select_set(True)
|
||||||
for part in tool.Aggregate.get_parts_recursively(tool.Ifc.get_entity(obj)):
|
for part in tool.Aggregate.get_parts_recursively(tool.Ifc.get_entity(obj)):
|
||||||
part_obj = tool.Ifc.get_object(part)
|
part_obj = tool.Ifc.get_object(part)
|
||||||
@@ -3291,6 +3290,7 @@ class EditRepresentationItemLayer(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
props = tool.Geometry.get_object_geometry_props(obj)
|
props = tool.Geometry.get_object_geometry_props(obj)
|
||||||
new_layer = ifc_file.by_id(int(props.representation_item_layer))
|
new_layer = ifc_file.by_id(int(props.representation_item_layer))
|
||||||
|
|
||||||
|
assert props.active_item
|
||||||
item = ifc_file.by_id(int(props.active_item.ifc_definition_id))
|
item = ifc_file.by_id(int(props.active_item.ifc_definition_id))
|
||||||
item_layer = next(iter(item.LayerAssignment), None)
|
item_layer = next(iter(item.LayerAssignment), None)
|
||||||
|
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ class Aggregate(bonsai.core.tool.Aggregate):
|
|||||||
return rel.RelatingObject
|
return rel.RelatingObject
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_aggregates_recursively(cls, element: ifcopenshell.entity_instance) -> set[ifcopenshell.entity_instance]:
|
def get_aggregates_recursively(cls, element: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
|
||||||
"""Get elements aggregates recursively, resulting set includes `element`."""
|
"""Get elements aggregates recursively, resulting set includes `element`."""
|
||||||
aggregates = list()
|
aggregates: list[ifcopenshell.entity_instance] = list()
|
||||||
queue = {element}
|
queue = {element}
|
||||||
while queue:
|
while queue:
|
||||||
element = queue.pop()
|
element = queue.pop()
|
||||||
|
|||||||
Reference in New Issue
Block a user