Salome HOME
Fix the problem of not previewed results of constraints applied. Flash Delete (for...
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Reference.cpp
index 20a07f53b12dc9323c034eaf8c4c430bab101590..f427b7e921fe59265c042d29cbd9e38cc50a4eea 100644 (file)
@@ -25,6 +25,11 @@ ModelHighAPI_Reference::ModelHighAPI_Reference(
     const std::shared_ptr<ModelHighAPI_Interface> & theValue)
 : myObject(std::shared_ptr<ModelAPI_Object>(theValue->defaultResult()))
 {
+  // the result is not constructed yet, forcibly do it
+  if (!myObject) {
+    theValue->execute(true);
+    myObject = std::shared_ptr<ModelAPI_Object>(theValue->defaultResult());
+  }
 }
 
 ModelHighAPI_Reference::~ModelHighAPI_Reference()