#include <ModelAPI_AttributeString.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Session.h>
+#include <ModelAPI_ResultPart.h>
#include <ModelHighAPI_Dumper.h>
ModelHighAPI_Dumper* aDumper = ModelHighAPI_Dumper::getInstance();
aDumper->clear();
DocumentPtr aDoc = ModelAPI_Session::get()->moduleDocument();
+
+ std::list<FeaturePtr> aFeatures = aDoc->allFeatures();
+ for(std::list<FeaturePtr>::const_iterator aFeatIt = aFeatures.begin();
+ aFeatIt != aFeatures.end();
+ ++aFeatIt) {
+ ResultPartPtr aResultPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>((*aFeatIt)->firstResult());
+ if(aResultPart.get()) {
+ if(!aResultPart->isActivated()) {
+ setError("Error: Not all parts are loaded. Can not dump.");
+ return;
+ }
+ }
+ }
+
if (!aDumper || !aDumper->process(aDoc, theFileName))
setError("An error occured while dumping to " + theFileName);
}