# Collects all features of exported results to find results of the same features and extend id.
# Map from feature index to index of result. If index is zero (initial), no surrfix to entry is added.
aFeaturesIndices = {}
+ cnt = 1
for aResId in range(aPartDoc.size(model.ModelAPI_ResultBody.group())):
+ # add part to study
+ if cnt==1:
+ aPartEntry = str(aPartFeatureId)
+ print(aPartEntry)
+ aPart = anEngine.FindOrCreateShape(aPartEntry)
+ aPart.SetShapeByStream(aPartRes.shape().getShapeStream(False))
+ if not aPart.GetSO(): # publish in case it is a new shape
+ anEngine.AddInStudy(aPart, aPartRes.data().name(), None)
+ allProcessed.append(aPartEntry)
+ cnt+=1
+
aResObject = aPartDoc.object(model.ModelAPI_ResultBody.group(), aResId)
aRes = model.objectToResult(aResObject)
#do not export images
aSShape = anEngine.FindOrCreateShape(aSSEntry)
aSShape.SetShapeByStream(aRes.shape().getShapeStream(False))
if not aSShape.GetSO(): # publish in case it is a new shape
- anEngine.AddInStudy(aSShape, aRes.data().name(), None)
+ anEngine.AddInStudy(aSShape, aRes.data().name(), aPart)
else: # restore a red reference if it was deleted
aDone, aSO2 = aSShape.GetSO().FindSubObject(1)
if aDone:
self.processGroups(aRes, anEngine, aPartFeatureId, aSShape, True)
# process all SHAPER-STUDY shapes to find dead
- aSOIter = SHAPERSTUDY_utils.getStudy().NewChildIterator(aComponent)
+ aSOIter = SHAPERSTUDY_utils.getStudy().NewChildIterator(aComponent) #must be adapted to accommodate the new structure
while aSOIter.More():
aSO = aSOIter.Value()
aSOIter.Next() # here because there is continue inside the loop