From 2fe95688a9e2d14d66c48b5b200c1677b558a141 Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 17 Nov 2015 15:03:32 +0300 Subject: [PATCH] Issue #1084: parameter cyclic dependence --- src/ParametersPlugin/ParametersPlugin_Parameter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp index 712533bbc..c51ae80de 100644 --- a/src/ParametersPlugin/ParametersPlugin_Parameter.cpp +++ b/src/ParametersPlugin/ParametersPlugin_Parameter.cpp @@ -104,9 +104,15 @@ double ParametersPlugin_Parameter::evaluate(const std::string& theExpression, st for ( ; it != anExprParams.end(); it++) { std::string& aVariableName = *it; + // parameter with the same name should be searched in the parent document + // currently there is no way to get parent document, so we get PartSet doc + DocumentPtr aDocument = document(); + if (data()->name() == aVariableName) + aDocument = ModelAPI_Session::get()->moduleDocument(); + double aValue; ResultParameterPtr aParamRes; - if (!ModelAPI_Tools::findVariable(aVariableName, aValue, aParamRes, document())) continue; + if (!ModelAPI_Tools::findVariable(aVariableName, aValue, aParamRes, aDocument)) continue; aParamsList.push_back(aParamRes); std::ostringstream sstream; -- 2.39.2