From 105ca0409d85455ee48a1caf39f48652761edeb8 Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 29 Dec 2016 16:37:24 +0300 Subject: [PATCH] Issue #1932: error when dump study with not loaded documents Changed error message. --- src/ExchangePlugin/ExchangePlugin_Dump.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ExchangePlugin/ExchangePlugin_Dump.cpp b/src/ExchangePlugin/ExchangePlugin_Dump.cpp index e81c896aa..f0f740671 100644 --- a/src/ExchangePlugin/ExchangePlugin_Dump.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Dump.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include @@ -48,6 +49,20 @@ void ExchangePlugin_Dump::dump(const std::string& theFileName) ModelHighAPI_Dumper* aDumper = ModelHighAPI_Dumper::getInstance(); aDumper->clear(); DocumentPtr aDoc = ModelAPI_Session::get()->moduleDocument(); + + std::list aFeatures = aDoc->allFeatures(); + for(std::list::const_iterator aFeatIt = aFeatures.begin(); + aFeatIt != aFeatures.end(); + ++aFeatIt) { + ResultPartPtr aResultPart = std::dynamic_pointer_cast((*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); } -- 2.39.2