From: mpv Date: Mon, 31 May 2021 08:40:32 +0000 (+0300) Subject: bos #24260 [CEA] Fatal error gp_Dir() input vector has zero norm when loading python... X-Git-Tag: V9_8_0a1~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a76006d25043c53afcc58863458c550c4d591bf1;p=modules%2Fshaper.git bos #24260 [CEA] Fatal error gp_Dir() input vector has zero norm when loading python dump Added an understandable error-message if the sketch plane is invalid. --- diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 9b9a83531..136336a15 100644 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -153,14 +154,23 @@ std::string getFeatureError(const FeaturePtr& theFeature) CompositeFeaturePtr aComposite = std::dynamic_pointer_cast(theFeature); if (aComposite) { + bool aHasSubError = false; for (int i = 0, aSize = aComposite->numberOfSubs(); i < aSize; i++) { FeaturePtr aSubFeature = aComposite->subFeature(i); std::string aSubFeatureError = getFeatureError(aSubFeature); if (!aSubFeatureError.empty()) { anError = anError + " in " + aSubFeature->getKind() + ".\n" + aSubFeatureError; + aHasSubError = true; break; } } + if (!aHasSubError) { // #24260: error not in the sub-features, but in the argument + if (aComposite->getKind() == "Sketch" && + aComposite->selection("External")->isInvalid()) { + anError = Config_Translator::translate(aComposite->getKind(), "The sketch base plane \ +is invalid, please push 'Change sketch plane' button to reselect it."); + } + } } } } diff --git a/src/SketchPlugin/SketchPlugin_msg_fr.ts b/src/SketchPlugin/SketchPlugin_msg_fr.ts index 9d6673d54..1bd553e91 100644 --- a/src/SketchPlugin/SketchPlugin_msg_fr.ts +++ b/src/SketchPlugin/SketchPlugin_msg_fr.ts @@ -150,6 +150,11 @@ Attribute "%1" is not initialized. Sélectionnez un plan pour l'esquisse + Sketch + + The sketch base plane is invalid, please push 'Change sketch plane' button to reselect it. + Le plan de base de l'esquisse n'est pas valide, veuillez appuyer sur le bouton 'Changer le plan de'esquisse' pour le resélectionner. + Sketch:DirX