From 2b65ef8fcf90221177ef73766abd32c8148f855d Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 13 Dec 2021 10:32:40 +0100 Subject: [PATCH] PD: make Loft working again when two sketches are pre-selected --- src/Mod/PartDesign/Gui/Command.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 1e0271e234..7303531e09 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -1042,9 +1042,16 @@ void prepareProfileBased(PartDesign::Body *pcActiveBody, Gui::Command* cmd, cons for (std::vector::size_type ii = 1; ii < selection.size(); ii++) { // Add subvalues even for sketches in case we just want points auto objCmdSection = Gui::Command::getObjectCmd(selection[ii].getObject()); + const auto& subnames = selection[ii].getSubNames(); std::ostringstream ss; - for (auto &s : selection[ii].getSubNames()) - ss << "'" << s << "',"; + if (!subnames.empty()) { + for (auto &s : subnames) + ss << "'" << s << "',"; + } + else { + // an empty string indicates the whole object + ss << "''"; + } FCMD_OBJ_CMD(Feat, "Sections += [(" << objCmdSection << ", [" << ss.str() << "])]"); } }