From 005c3db946719c5fe7023694ea2389e68ede94fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Sun, 8 Nov 2015 19:07:33 +0100 Subject: [PATCH] fix sketch classification for other body hasObject does search recursive only in groups, but a body is not a group. Hence for sketches within a body this will always return false. Annother logic must be used to detect sketches in bodies. --- src/Mod/PartDesign/Gui/Command.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index a58ac8666c..87190cd933 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; }