aDumper->clear();
DocumentPtr aDoc = ModelAPI_Session::get()->moduleDocument();
+ int aFeaturesNb = aDoc->size(ModelAPI_Feature::group());
+ if(aFeaturesNb > 1) {
+ FeaturePtr aLastFeature =
+ ModelAPI_Feature::feature(aDoc->object(ModelAPI_Feature::group(), aFeaturesNb - 1));
+ if(aDoc->currentFeature(true) != aLastFeature) {
+ setError("Dump cannot be done. Please move the history line to the end before dumping.");
+ return;
+ }
+ }
+
+ DocumentPtr anActiveDoc = ModelAPI_Session::get()->activeDocument();
+ aFeaturesNb = anActiveDoc->size(ModelAPI_Feature::group());
+ if(aFeaturesNb > 1) {
+ FeaturePtr aLastFeature =
+ ModelAPI_Feature::feature(anActiveDoc->object(ModelAPI_Feature::group(), aFeaturesNb - 1));
+ if(anActiveDoc->currentFeature(true) != aLastFeature) {
+ setError("Dump cannot be done. Please move the history line to the end before dumping.");
+ return;
+ }
+ }
+
std::list<FeaturePtr> aFeatures = aDoc->allFeatures();
for(std::list<FeaturePtr>::const_iterator aFeatIt = aFeatures.begin();
aFeatIt != aFeatures.end();