From 959230561ac3fcbb0dac8914aa20d67dffafa165 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 11 Aug 2016 13:35:44 +0300 Subject: [PATCH] Dump Python in the High Level Parameterized Geometry API (issue #1648) * Avoid to dump additional "Fixed" constraint for external features --- src/SketchAPI/SketchAPI_Constraint.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/SketchAPI/SketchAPI_Constraint.cpp b/src/SketchAPI/SketchAPI_Constraint.cpp index 6870cc63d..617a0bfa6 100644 --- a/src/SketchAPI/SketchAPI_Constraint.cpp +++ b/src/SketchAPI/SketchAPI_Constraint.cpp @@ -132,6 +132,16 @@ void SketchAPI_Constraint::dump(ModelHighAPI_Dumper& theDumper) const if (!aConstraint) return; // dump constraints only + // do not need to dump "Fixed" constraint for external object + if (aConstraint->getKind() == SketchPlugin_ConstraintRigid::ID()) { + AttributeRefAttrPtr aRefAttr = aConstraint->refattr(SketchPlugin_Constraint::ENTITY_A()); + std::shared_ptr aSketchFeature = + std::dynamic_pointer_cast( + ModelAPI_Feature::feature(aRefAttr->object())); + if (!aSketchFeature || aSketchFeature->isExternal()) + return; + } + const std::string& aSetter = constraintTypeToSetter(aConstraint->getKind()); if (aSetter.empty()) return; // incorrect constraint type -- 2.39.2