diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp index 92c6c7bd8a66..f98c72966e64 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(),