mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
2138b0750a
remove_representation_item assumed a representation item's parent is always the IfcShapeRepresentation (or an IfcBooleanResult). Items that live inside a container item were detached from nothing, so they stayed in the file and were re-imported on leaving item mode (#6591). The import side is already general. The C++ mapper tags every mapped IfcRepresentationItem with its instance id, and container items are mapped through the same map_to_collection helper as IfcRepresentation.Items, so their children become individually editable items with no special casing. Deletion now mirrors that: any inverse that is itself a representation item is treated as a container, and the item is cleared from whichever attribute references it. A container left without contents is removed in turn. This covers IfcGeometricSet/IfcGeometricCurveSet Elements, IfcShellBasedSurfaceModel SbsmBoundary and IfcFaceBasedSurfaceModel FbsmFaces, rather than only the case reported in #6591. Items shared by several containers are detached from all of them, which matches item mode presenting one object per item id. Fixes #6591 Generated with the assistance of an AI coding tool.