if(!aConstruction.get()) {
return;
}
- selection(SKETCH_SELECTION_ID())->setValue(aSketchRes, std::shared_ptr<GeomAPI_Shape>());
+
+ if (!selection(SKETCH_SELECTION_ID())->isInitialized() || selection(SKETCH_SELECTION_ID())->context() != aSketchRes) {
+ selection(SKETCH_SELECTION_ID())->setValue(aSketchRes, std::shared_ptr<GeomAPI_Shape>());
+ }
int aSketchFacesNum = aConstruction->facesNum();
if(aSketchFacesNum == 0) {
return;
return MY_SKETCH_OBJECT_ID;
}
- /// Attribute name of sketch feature.
+ /// Attribute name of sketch feature selection: needed for naming of the selected sketch.
inline static const std::string& SKETCH_SELECTION_ID()
{
static const std::string MY_SKETCH_SELECTION_ID("sketch_selection");
// place where results are cleared)
myIsParamUpdated = false;
myUpdated.clear();
- myModification = 0;
+ // do not erase it since there may be modification increment on start of operation
+ //myModification = 0;
myWaitForFinish.clear();
}
}
isAutomaticChanged = true;
myIsAutomatic = true;
}
+ // modifications inside of the iteration will be different from modification that comes outside
+ myModification++;
// init iteration from the root document
iterateUpdate(CompositeFeaturePtr());
std::shared_ptr<ModelAPI_Result> aRes = *aRIter;
if (!aRes->isDisabled()) {
std::map<std::shared_ptr<ModelAPI_Object>, int >::iterator anRIter = myUpdated.find(aRes);
+ int aResultID = aRes->data()->updateID();
+ if (aResultID < anArgID)
+ return true;
if (anRIter == myUpdated.end()) // not updated at all
return true;
if (anRIter->second < anAIter->second)