From 64814303b8645555fb4973d3b1c336e003854174 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Thu, 22 Oct 2020 12:23:28 +0200 Subject: [PATCH] Fix issue "addImport", ascending compatibility --- src/ExchangeAPI/ExchangeAPI_Import.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) 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(); } //-------------------------------------------------------------------------------------- -- 2.39.2