Salome HOME
Log desktop actions
[modules/shaper.git] / src / Model / Model_Update.cpp
index 934df7d85c03a8a4a0d80426fc22e6f9dcd0f0b2..aa0fb4cf763f34bd68a9c1d3895c030f3999a252 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -894,7 +894,9 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
           bool isObligatory = !aFactory->isNotObligatory(
             theFeature->getKind(), theFeature->data()->id(aSel)) &&
             aFactory->isCase(theFeature, theFeature->data()->id(aSel));
-          if (isObligatory)
+          if (isObligatory ||
+            // #24260 : sketch plane was selected, but selection becomes wrong, make it invalid
+            (theFeature->getKind() == "Sketch" && aSel->id() == "External"))
             aState = ModelAPI_StateInvalidArgument;
         }
       }
@@ -903,8 +905,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
       bool isObligatory = aFactory->isCase(theFeature, theFeature->data()->id(aSel));
       if (isObligatory)
         aState = ModelAPI_StateInvalidArgument;
-    } else if (theFeature->getKind() == "Sketch" && aSel->id() == "External" &&
-               aSel->isInitialized()) {
+    } else if (aSel->isInitialized()) {
       // #19703 : if sketch plane was selected, but after context disappears, it must become invalid
       aSel->update();
       if (aSel->isInvalid()) {