From 3ef3b583309df4b9d0593c7abd181ab9d6fed42e Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 15 Feb 2018 11:05:25 +0300 Subject: [PATCH] Issue #2440 Can't validate coincidence between a line and an imported line Coincidence to exported line will create invalid projection feature which does not allow validating of the sketch. The projection should be removed. --- src/PartSet/PartSet_Tools.cpp | 6 ++++++ src/XGUI/XGUI_Workshop.cpp | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 4430699bb..4d00067fe 100755 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -374,7 +374,13 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal( 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 aFeatures; + aFeatures.insert(aProjectionFeature); + ModelAPI_Tools::removeFeaturesAndReferences(aFeatures); return ResultPtr(); + } FeaturePtr aProjection = ModelAPI_Feature::feature(aRefAttr->object()); if (aProjection.get() && aProjection->lastResult().get()) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index db264ad2b..4ff214d08 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1923,7 +1923,6 @@ void XGUI_Workshop::moveObjects() //************************************************************** bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theObjects) { - std::map > aReferences; std::set aFeatures; ModuleBase_Tools::convertToFeatures(theObjects, aFeatures); -- 2.39.2