#include "SketchPlugin_MacroArc.h"
#include "SketchPlugin_MacroCircle.h"
#include "SketchPlugin_MultiRotation.h"
+#include "SketchPlugin_Offset.h"
#include "SketchPlugin_Point.h"
#include "SketchPlugin_Sketch.h"
#include "SketchPlugin_Trim.h"
// B-splines are not supported in Copying features
FeaturePtr aSelFeature = ModelAPI_Feature::feature(aSelObject);
- if (aSelFeature && (aSelFeature->getKind() == SketchPlugin_BSpline::ID() ||
+ if (aFeature->getKind() != SketchPlugin_Offset::ID() &&
+ aSelFeature && (aSelFeature->getKind() == SketchPlugin_BSpline::ID() ||
aSelFeature->getKind() == SketchPlugin_BSplinePeriodic::ID())) {
theError = "Not supported";
return false;
}
anObjIter = aCopiedObjects.begin();
- for (; anObjIter != aCopiedObjects.end(); anObjIter++)
- if (aSelObject == *anObjIter) {
+ for (; anObjIter != aCopiedObjects.end(); anObjIter++) {
+ bool isFound = aSelObject == *anObjIter;
+ if (!isFound) {
+ // check in the results of the feature
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(*anObjIter);
+ const std::list<ResultPtr>& aResults = aFeature->results();
+ for (std::list<ResultPtr>::const_iterator aResIt = aResults.begin();
+ aResIt != aResults.end() && !isFound; ++aResIt) {
+ isFound = aSelObject == *aResIt;
+ }
+ }
+ if (isFound) {
std::wstring aName = aSelObject.get() ? aSelObject->data()->name() : L"";
theError = "The object %1 is a result of copy";
theError.arg(aName);
return false;
}
+ }
}
return true;
}