diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index a58ac8666..87190cd93 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -646,15 +646,15 @@ const unsigned validateSketches(std::vector& sketches, continue; } } else if (!pcActiveBody->hasFeature(*s)) { - // Check whether this plane belongs to the active body - if(pcActivePart && pcActivePart->hasObject(*s, true)) { - status.push_back(PartDesignGui::TaskFeaturePick::otherBody); - } else if (PartDesign::Body::findBodyOf(*s)) { - status.push_back(PartDesignGui::TaskFeaturePick::otherPart); - } else { + // Check whether this plane belongs to a body of the same part + PartDesign::Body* b = PartDesign::Body::findBodyOf(*s); + if(!b) status.push_back(PartDesignGui::TaskFeaturePick::notInBody); - } - + else if(pcActivePart && pcActivePart->hasObject(b, true)) + status.push_back(PartDesignGui::TaskFeaturePick::otherBody); + else + status.push_back(PartDesignGui::TaskFeaturePick::otherPart); + continue; }