Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketchAPI / SketchAPI_Translation.cpp
index 05dcb1c8f994fd05a3f1b34a9e166767e4235942..dddf3b4ad7b0455eca4f2573a182f21a7471d295 100644 (file)
@@ -86,6 +86,13 @@ void SketchAPI_Translation::dump(ModelHighAPI_Dumper& theDumper) const
   AttributeIntegerPtr aNbCopies = numberOfObjects();
   bool isFullValue = valueType()->value() != "SingleValue";
 
+  // Check all attributes are already dumped. If not, store the constraint as postponed.
+  if (!theDumper.isDumped(aStart) || !theDumper.isDumped(aEnd) ||
+      !theDumper.isDumped(aTransObjects)) {
+    theDumper.postpone(aBase);
+    return;
+  }
+
   theDumper << aBase << " = " << aSketchName << ".addTranslation("
             << aTransObjects << ", " << aStart << ", " << aEnd << ", " << aNbCopies;
   if (isFullValue)