- //aNewBody = createPart(theFeature->data(), aResIndex);
- theFeature->execute(); // create the part result
+ std::shared_ptr<ModelAPI_ResultPart> aNewP = createPart(theFeature->data(), aResIndex);
+ theFeature->setResult(aNewP, aResIndex);
+ if (!aNewP->partDoc().get())
+ theFeature->execute(); // create the part result: it is better to restore the previous result if it is possible