diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index 788acf7f34..1c90f3d391 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -119,17 +119,13 @@ def is_representation_of_context(representation, context, subcontext=None, targe def remove_deep(ifc_file, element): + # @todo maybe some sort of try-finally mechanism. + ifc_file.batch() subgraph = list(ifc_file.traverse(element)) subgraph_set = set(subgraph) for ref in subgraph[::-1]: if ref.id() and len(set(ifc_file.get_inverse(ref)) - subgraph_set) == 0: ifc_file.remove(ref) - - -def remove_deep_batched(ifc_file, element): - # @todo maybe some sort of try-finally mechanism. - ifc_file.batch() - remove_deep(ifc_file, element) ifc_file.unbatch()