mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-08 08:51:35 +00:00
remove_representation not to leave brokens refs with batch_remove #4138
This commit is contained in:
@@ -49,9 +49,10 @@ class Usecase:
|
||||
for texture in textures:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, texture)
|
||||
|
||||
to_delete = getattr(self.file, "to_delete", ())
|
||||
for element in styled_items:
|
||||
if not element.Item:
|
||||
if not element.Item or element.Item in to_delete:
|
||||
self.file.remove(element)
|
||||
for element in presentation_layer_assignments:
|
||||
if len(element.AssignedItems) == 0:
|
||||
if all(item in to_delete for item in element.AssignedITems):
|
||||
self.file.remove(element)
|
||||
|
||||
Reference in New Issue
Block a user