for aResIndex in range(self.Part.size(aResultType)):
anObject = self.Part.object(aResultType, aResIndex)
aResult = model.objectToResult(anObject)
+ # do nt export picture
+ if aResult.hasTextureFile() is True:
+ continue
if not aResult is None:
if (not aResult.shape() or aResult.shape().isNull()) and isPart:
aPart = model.modelAPI_ResultPart(aResult)
# Map from feature index to index of result. If index is zero (initial), no surrfix to entry is added.
aFeaturesIndices = {}
for aResId in range(aPartDoc.size(model.ModelAPI_ResultBody_group())):
- aResObject = aPartDoc.object(model.ModelAPI_ResultBody_group(), aResId)
+ aResObject = aPartDoc.object(model.ModelAPI_ResultBody_group(), aResId)
aRes = model.objectToResult(aResObject)
+ #do not export images
+ if aRes.hasTextureFile() is True:
+ continue
aResFeatureId = str(aPartDoc.feature(aRes).data().featureId())
if aResFeatureId in aFeaturesIndices:
aFeaturesIndices[aResFeatureId] += 1
std::list<DocumentPtr> aDocuments; /// documents of Parts selected and used in export
std::map<DocumentPtr, GeomTrsfPtr> aDocTrsf; /// translation of the part
+ bool anExCludedIsImage = false;
AttributeSelectionListPtr aSelection = selectionList(XAO_SELECTION_LIST_ID());
bool aIsSelection = aSelection->isInitialized() && aSelection->size() > 0;
if (aIsSelection) { // a mode for export to geom result by result
AttributeSelectionPtr anAttr = aSelection->value(a);
ResultPtr aBodyContext =
std::dynamic_pointer_cast<ModelAPI_Result>(anAttr->context());
- if (aBodyContext.get() && !aBodyContext->isDisabled() && aBodyContext->shape().get()
+ if (aBodyContext.get() && !aBodyContext->isDisabled() && aBodyContext->shape().get()) {
/// do not export pictures
- && !aBodyContext->hasTextureFile()) {
+ if(aBodyContext->hasTextureFile()){
+ anExCludedIsImage = true;
+ continue;
+ }
aResults.push_back(aBodyContext);
GeomShapePtr aShape = anAttr->value();
if (!aShape.get())
}
}
if (aShapes.empty()) {
- setError("No shapes to export");
+ if(!anExCludedIsImage)
+ setError("No shapes to export");
return;
}