if (aFeatOwner.get() && !aFactory->isCase(aFeatOwner, theAttr->id())) {
return "__notcase__";
}
+ std::string aType = theAttr->attributeType();
+ std::ostringstream aResult;
if (!theAttr->isInitialized()) {
+ if (aType == ModelAPI_AttributeBoolean::typeId()) {
+ // special case for Boolean attribute (mean it false if not initialized)
+ aResult << false;
+ return aResult.str();
+ } else if (aType == ModelAPI_AttributeString::typeId()) {
+ // special case for attribute "SolverError"
+ if (theAttr->id() == "SolverError" &&
+ std::dynamic_pointer_cast<ModelAPI_Feature>(theAttr->owner())->getKind() == "Sketch")
+ return "";
+ }
+
return "__notinitialized__";
}
- std::string aType = theAttr->attributeType();
- std::ostringstream aResult;
if (aType == ModelAPI_AttributeDocRef::typeId()) {
AttributeDocRefPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeDocRef>(theAttr);
DocumentPtr aDoc = ModelAPI_Session::get()->moduleDocument();
} else if (aType == ModelAPI_AttributeDouble::typeId()) {
AttributeDoublePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(theAttr);
if (anAttr->text().empty())
- aResult<<anAttr->value();
+ aResult<<std::fixed<<setprecision(7)<<anAttr->value();
else
aResult<<anAttr->text();
} else if (aType == ModelAPI_AttributeBoolean::typeId()) {