Salome HOME
To avoid exception, if the list of selected objects is empty.
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_Deflection1D_i.cxx
index 84ef5e96d3de9de4f91ee41c11583ca41ec200ea..78ef384cc2b8e948867619a7ce2a83799c792e67 100644 (file)
 
 using namespace std;
 #include "StdMeshers_Deflection1D_i.hxx"
+#include "SMESH_Gen_i.hxx"
 #include "SMESH_Gen.hxx"
 
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
 
+#include <TCollection_AsciiString.hxx>
+
 //=============================================================================
 /*!
  *  StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i
@@ -87,6 +90,13 @@ void StdMeshers_Deflection1D_i::SetDeflection( CORBA::Double theValue )
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
                                  SALOME::BAD_PARAM );
   }
+
+  // Update Python script
+  TCollection_AsciiString aStr, aStrVal ((double)theValue);
+  SMESH_Gen_i::AddObject(aStr, _this()) += ".SetDeflection(";
+  aStr += aStrVal + ")";
+
+  SMESH_Gen_i::AddToCurrentPyScript(aStr);
 }
 
 //=============================================================================