mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
copy_deep to always pass exclude_callback to the recursion
It wasn't passing the exclude_callback if attribute of the copied element wasn't a tuple, resulting in duplicated named profiles in case if you'd copy a IfcBooleanClippingResult #3810 For example, how copy_deep of IfcProductDefinitionShape with boolean clipping previously would work: V IfcShapeRepresentation - copied with exlude_callback (part of .Representations[]) V IfcBooleanClippingResult - copied with exlude_callback (part of .Items[]) X IfcExtrudedAreaSolid - copied without exlude_callback becuase it's part of .FirstOperand (not an array) and we have IfcIShapeProfileDef duplicated Case without booleanclippings: V IfcShapeRepresentation - copied with exlude_callback (part of .Representations[]) V IfcExtrudedAreaSolid - copied with exlude_callback, since it's part of .Items[], IfcIShapeProfileDef not duplicated
This commit is contained in:
@@ -1022,7 +1022,13 @@ def copy_deep(ifc_file, element, exclude=None, exclude_callback=None, copied_ent
|
||||
elif exclude_callback and exclude_callback(attribute):
|
||||
pass
|
||||
else:
|
||||
attribute = copy_deep(ifc_file, attribute, exclude=exclude, copied_entities=copied_entities)
|
||||
attribute = copy_deep(
|
||||
ifc_file,
|
||||
attribute,
|
||||
exclude=exclude,
|
||||
copied_entities=copied_entities,
|
||||
exclude_callback=exclude_callback,
|
||||
)
|
||||
elif isinstance(attribute, tuple) and attribute and isinstance(attribute[0], ifcopenshell.entity_instance):
|
||||
if exclude and any([attribute[0].is_a(e) for e in exclude]):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user