}
}
- ResultBodyPtr aContextOwner = ModelAPI_Tools::bodyOwner(aContext);
- GeomShapePtr anOwner = aContextOwner.get() ? aContextOwner->shape() : aContext->shape();
+ ResultBodyPtr aContextOwner = ModelAPI_Tools::bodyOwner(aContext, true);
+ GeomShapePtr anOwner = aContext->shape();
+ GeomShapePtr aTopLevelOwner = aContextOwner.get() ? aContextOwner->shape() : anOwner;
if (!anOwner) {
theError = "Error: wrong feature is selected.";
}
if (!aBaseSolid)
- aBaseSolid = anOwner;
- else if (!aBaseSolid->isEqual(anOwner)) {
+ aBaseSolid = aTopLevelOwner;
+ else if (!aBaseSolid->isEqual(aTopLevelOwner)) {
theError = "Error: Sub-shapes of different solids have been selected.";
return false;
}