]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
Salome HOME
[bos #26800] EDF 24492 - Pb with defeaturing
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Validators.cpp
index 828b4bdd8be11a16e42b47681b24bc382442d431..b5aa56afed87a137bedd12518c300f045c37f966 100644 (file)
@@ -2019,6 +2019,14 @@ bool FeaturesPlugin_ValidatorDefeaturingSelection::isValid(
       theError = "Error: Not all selected shapes are sub-shapes of solids.";
       return false;
     }
+
+    ResultBodyPtr aResRootPtr = ModelAPI_Tools::bodyOwner(aContext, true);
+    if (aResRootPtr.get() && aResRootPtr->shape().get()) {
+      if (!aResRootPtr->shape()->isCollectionOfSolids()) {
+        theError = "Error: The main shape should be a collection of solids";
+        return false;
+      }
+    }
   }
 
   return true;