From: Jérôme Date: Thu, 22 Oct 2020 10:23:28 +0000 (+0200) Subject: Fix issue "addImport", ascending compatibility X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=64814303b8645555fb4973d3b1c336e003854174;p=modules%2Fshaper.git Fix issue "addImport", ascending compatibility --- diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index 059467a25..70761000b 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -87,18 +87,13 @@ void ExchangeAPI_Import::setParameters(const std::string & theFilePath, void ExchangeAPI_Import::setFilePath(const std::string & theFilePath) { fillAttribute(theFilePath, myfilePath); - std::string aFrom = "\\"; - std::string aTo = "\\\\"; - std::string aFilePath = theFilePath; - for(std::size_t aPos = aFilePath.find(aFrom); - aPos != std::string::npos; - aPos = aFilePath.find(aFrom, aPos)) { - aFilePath.replace(aPos, aFrom.size(), aTo); - aPos += aTo.size(); + std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(theFilePath); + if (anExtension == "STEP" || anExtension == "STP") { + setParameters(theFilePath,true,false,false); + }else{ + fillAttribute(anExtension, feature()->string(ExchangePlugin_ImportFeature::IMPORT_TYPE_ID())); + execute(); } - std::string anExtension = GeomAlgoAPI_Tools::File_Tools::extension(aFilePath); - fillAttribute(anExtension, feature()->string(ExchangePlugin_ImportFeature::IMPORT_TYPE_ID())); - execute(); } //--------------------------------------------------------------------------------------