Salome HOME
Fix the problem of the sketch plane update
[modules/shaper.git] / src / BuildAPI / BuildAPI_Interpolation.cpp
index 201151d82c8f9c86c89f900ee088949a00dc9db3..6333fa0ae6e345bf6cd8a095541c6d5993d6c7ef 100644 (file)
@@ -115,15 +115,18 @@ void BuildAPI_Interpolation::dump(ModelHighAPI_Dumper& theDumper) const
 
   AttributeSelectionListPtr anAttrBaseObjects =
     aBase->selectionList(BuildPlugin_Interpolation::BASE_OBJECTS_ID());
-  AttributeSelectionPtr anAttrStartTangent =
-    aBase->selection(BuildPlugin_Interpolation::TANGENT_START_ID());
-  AttributeSelectionPtr anAttrEndTangent =
-    aBase->selection(BuildPlugin_Interpolation::TANGENT_END_ID());
 
   theDumper << aBase << " = model.addInterpolation(" << aPartName << ", "
             << anAttrBaseObjects << ", ";
 
-  if (anAttrStartTangent->isInitialized() && anAttrEndTangent->isInitialized()) {
+  AttributeStringPtr useTangentsAttr = useTangents();
+  std::string useTangents = useTangentsAttr->value();
+  if (!useTangents.empty()) {
+    AttributeSelectionPtr anAttrStartTangent =
+      aBase->selection(BuildPlugin_Interpolation::TANGENT_START_ID());
+    AttributeSelectionPtr anAttrEndTangent =
+      aBase->selection(BuildPlugin_Interpolation::TANGENT_END_ID());
+
     theDumper << anAttrStartTangent << ", " << anAttrEndTangent << ", ";
   }