From 15225b3b09067a6eb0982c9dcea6269fa272ed0e Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Wed, 10 Nov 2021 22:30:44 -0500 Subject: [PATCH] [PD] Allow body faces when making loft by pre-selection --- src/Mod/PartDesign/Gui/Command.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 5e74f23473..776e1a0db8 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -1019,10 +1019,12 @@ void prepareProfileBased(PartDesign::Body *pcActiveBody, Gui::Command* cmd, cons std::vector selection = cmd->getSelection().getSelectionEx(); if (selection.size() > 1) { //treat additional selected objects as sections for (std::vector::size_type ii = 1; ii < selection.size(); ii++) { - if (selection[ii].getObject()->isDerivedFrom(Part::Part2DObject::getClassTypeId())) { - auto objCmdSection = Gui::Command::getObjectCmd(selection[ii].getObject()); - FCMD_OBJ_CMD(Feat, "Sections += [" << objCmdSection << "]"); - } + // Add subvalues even for sketches in case we just want points + auto objCmdSection = Gui::Command::getObjectCmd(selection[ii].getObject()); + std::ostringstream ss; + for (auto &s : selection[ii].getSubNames()) + ss << "'" << s << "',"; + FCMD_OBJ_CMD(Feat, "Sections += [(" << objCmdSection << ", [" << ss.str() << "])]"); } } }