Sketch: Make sure that variable 'ActiveSketch' is defined in macro

Fixes #17502
This commit is contained in:
wmayer
2024-10-27 17:23:08 +01:00
committed by Yorik van Havre
parent 3897ec8b39
commit e44c59d2a8

View File

@@ -1179,9 +1179,11 @@ protected:
void commandAddShapeGeometryAndConstraints()
{
auto shapeGeometry = toPointerVector(ShapeGeometry);
std::string sketchObj = Gui::Command::getObjectCmd(sketchgui->getObject());
Gui::Command::doCommand(Gui::Command::Doc, "ActiveSketch = %s\n", sketchObj.c_str());
Gui::Command::doCommand(Gui::Command::Doc,
Sketcher::PythonConverter::convert(
Gui::Command::getObjectCmd(sketchgui->getObject()),
sketchObj,
shapeGeometry,
Sketcher::PythonConverter::Mode::OmitInternalGeometry)
.c_str());
@@ -1189,9 +1191,7 @@ protected:
auto shapeConstraints = toPointerVector(ShapeConstraints);
Gui::Command::doCommand(
Gui::Command::Doc,
Sketcher::PythonConverter::convert(Gui::Command::getObjectCmd(sketchgui->getObject()),
shapeConstraints)
.c_str());
Sketcher::PythonConverter::convert(sketchObj, shapeConstraints).c_str());
}
/** @brief Function to draw as an edit curve all the geometry in the ShapeGeometry vector.*/