From 46ce091344d63d23cf933597854de9d30c337165 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 13 Jun 2022 17:08:58 +0200 Subject: [PATCH] Fem: in FEM_PostFilterLinearizedStresses command do not use a hard-coded object name but that of the selected FemPostDataAlongLineFilter --- src/Mod/Fem/Gui/Command.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp index 92c6c7bd8a..f98c72966e 100644 --- a/src/Mod/Fem/Gui/Command.cpp +++ b/src/Mod/Fem/Gui/Command.cpp @@ -33,10 +33,11 @@ #endif #include +#include #include #include #include -#include +#include #include #include #include @@ -1491,9 +1492,11 @@ void CmdFemPostLinearizedStressesFilter::activated(int) ) { // TODO FIXME only works if the data along the line object has the name DataAlongLine // we should get the selected data along the line object - doCommand(Gui::Command::Doc, "t_coords = App.ActiveDocument.DataAlongLine.XAxisData"); - doCommand(Gui::Command::Doc, "sValues = App.ActiveDocument.DataAlongLine.YAxisData"); - doCommand(Gui::Command::Doc, Plot().c_str()); + App::DocumentObjectT objT(DataAlongLine); + std::string ObjName = objT.getObjectPython(); + Gui::doCommandT(Gui::Command::Doc, "t_coords = %s.XAxisData", ObjName); + Gui::doCommandT(Gui::Command::Doc, "sValues = %s.YAxisData", ObjName); + Gui::doCommandT(Gui::Command::Doc, Plot().c_str()); } else { QMessageBox::warning(Gui::getMainWindow(),