Coincidence to exported line will create invalid projection feature which does not allow validating of the sketch. The projection should be removed.
AttributeRefAttrPtr aRefAttr = aProjectionFeature->data()->refattr(
SketchPlugin_Projection::PROJECTED_FEATURE_ID());
if (!aRefAttr || !aRefAttr->isInitialized())
+ {
+ // remove external feature if the attribute is not filled
+ std::set<FeaturePtr> aFeatures;
+ aFeatures.insert(aProjectionFeature);
+ ModelAPI_Tools::removeFeaturesAndReferences(aFeatures);
return ResultPtr();
+ }
FeaturePtr aProjection = ModelAPI_Feature::feature(aRefAttr->object());
if (aProjection.get() && aProjection->lastResult().get())
//**************************************************************
bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theObjects)
{
- std::map<FeaturePtr, std::set<FeaturePtr> > aReferences;
std::set<FeaturePtr> aFeatures;
ModuleBase_Tools::convertToFeatures(theObjects, aFeatures);