From 807bfbc6aac252230d6fff790240dbad165af123 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 8 Jul 2015 12:11:55 +0300 Subject: [PATCH] Regression fix. The rigit is created by preselection correctly. --- src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp index 78574b338..8867e16d5 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp @@ -36,7 +36,17 @@ AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious AISObjectPtr anAIS = thePrevious; if (anAIS.get() == NULL) { - anAIS = SketcherPrs_Factory::rigidConstraint(this, sketch()->coordinatePlane()); + std::shared_ptr aData = data(); + std::shared_ptr anAttr = + std::dynamic_pointer_cast(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); + ObjectPtr aObj = anAttr->object(); + if (aObj.get() != NULL) { + FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + std::shared_ptr aSkFea = + std::dynamic_pointer_cast(aFeature); + if (!aSkFea->isExternal()) + anAIS = SketcherPrs_Factory::rigidConstraint(this, sketch()->coordinatePlane()); + } } return anAIS; -- 2.39.2