#include "ModelAPI_Data.h"
#include "ModelAPI_AttributeDocRef.h"
#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Events.h>
using namespace std;
// do not activate part by simple execution if it is not loaded yet: it must be explicitly
// activated for this
if (!ModelAPI_Session::get()->isLoadByDemand(aResult->data()->name())) {
+ // On undo/redo creation of the part result the Object Borwser must get creation event
+ // earlier that activation of this part event (otherwise the crash is producted)
+ // So, send a creation event earlier, without any grouping
+ static Events_ID aCreateID = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
+ ModelAPI_EventCreator::get()->sendUpdated(aResult, aCreateID, false);
+
aResult->activate();
}
}