ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
DocumentPtr aDoc = aResult->partDoc();
- if (aDoc.get())
+ if (aDoc.get() && aDoc->isOpened())
return aDoc->addFeature(theID);
}
return FeaturePtr();
ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
DocumentPtr aDoc = aResult->partDoc();
- if (aDoc.get())
+ if (aDoc.get() && aDoc->isOpened())
return aDoc->numInternalFeatures();
}
return 0;
ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
DocumentPtr aDoc = aResult->partDoc();
- if (aDoc.get()) {
+ if (aDoc.get() && aDoc->isOpened()) {
return aDoc->internalFeature(theIndex);
}
}
ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
DocumentPtr aDoc = aResult->partDoc();
- if (aDoc.get()) {
+ if (aDoc.get() && aDoc->isOpened()) {
return aDoc->object(ModelAPI_Feature::group(), theIndex)->data()->featureId();
}
}
ResultPartPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultPart>(firstResult());
if (aResult.get()) {
DocumentPtr aDoc = aResult->partDoc();
- if (aDoc.get())
+ if (aDoc.get() && aDoc->isOpened())
aDoc->removeFeature(theFeature);
}
}