From ef2437bb5c2c6b6673610dbc2f7650329eb635e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Sun, 8 Nov 2015 16:10:43 +0100 Subject: [PATCH] Fix sketch on face of other body or part The shapebinder object reduces the number of faces to 1, hence the subshape to select is always Face1 and not the original face name --- src/Mod/PartDesign/Gui/Command.cpp | 3 ++- src/Mod/PartDesign/Gui/TaskFeaturePick.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 214857722..3efd8fb1d 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -423,7 +423,8 @@ void CmdPartDesignNewSketch::activated(int iMsg) if(PlaneFilter.match()) supportString = std::string("(App.activeDocument().") + copy->getNameInDocument() + ", '')"; else - supportString = std::string("(App.activeDocument().") + copy->getNameInDocument() + ", '" + sub +"')"; + //it is ensured that only a single face is selected, hence it must always be Face1 of the shapebinder + supportString = std::string("(App.activeDocument().") + copy->getNameInDocument() + ", 'Face1')"; } } } diff --git a/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp b/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp index a3ac9298a..a0e4e8c94 100644 --- a/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp +++ b/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp @@ -320,7 +320,13 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st } else { - auto name = std::string("Reference") + std::string(obj->getNameInDocument()); + std::string name; + if(!independent) + name = std::string("Reference"); + else + name = std::string("Copy"); + name += std::string(obj->getNameInDocument()); + std::string entity; if(!sub.empty()) entity = sub;