diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index 10ae0fd744..eb0fb12b72 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -69,9 +69,16 @@ void PropertyPartShape::setValue(const TopoShape& sh) _Shape = sh; auto obj = freecad_cast(getContainer()); if(obj) { + if(_Shape.getElementMap().size() != sh.getElementMap().size()) { + TopoShape res(obj->getID(), sh.Hasher, _Shape.getShape()); + res.mapSubElement(_Shape); + _Shape = res; + } + auto tag = obj->getID(); if(_Shape.Tag && tag!=_Shape.Tag) { auto hasher = _Shape.Hasher?_Shape.Hasher:obj->getDocument()->getStringHasher(); + _Shape.reTagElementMap(tag,hasher); } else _Shape.Tag = obj->getID();