mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
#1376 remove_deep_batched()
This commit is contained in:
@@ -179,6 +179,14 @@ class file(object):
|
||||
:rtype: None
|
||||
"""
|
||||
return self.wrapped_data.remove(inst.wrapped_data)
|
||||
|
||||
def batch(self):
|
||||
"""Low-level mechanism to speed up deletion of large subgraphs"""
|
||||
return self.wrapped_data.batch()
|
||||
|
||||
def unbatch(self):
|
||||
"""Low-level mechanism to speed up deletion of large subgraphs"""
|
||||
return self.wrapped_data.unbatch()
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self[id] for id in self.wrapped_data.entity_names())
|
||||
|
||||
@@ -126,6 +126,13 @@ def remove_deep(ifc_file, element):
|
||||
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()
|
||||
|
||||
|
||||
def get_representation(element, context, subcontext=None, target_view=None):
|
||||
if element.is_a("IfcProduct") and element.Representation:
|
||||
for r in element.Representation.Representations:
|
||||
|
||||
Reference in New Issue
Block a user