From fc67151dbfab0f3d607e5c64148990eda59bfded Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Thu, 25 Apr 2013 17:28:27 +0200 Subject: [PATCH] Fix bug on PARAMETRIC component loading in batch Data in PARAMETRIC component was not read correctly from the study when the parametric study was run in batch mode. --- src/salome/parametric/genjob.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/salome/parametric/genjob.py b/src/salome/parametric/genjob.py index 1acde4d..04c0aa0 100644 --- a/src/salome/parametric/genjob.py +++ b/src/salome/parametric/genjob.py @@ -24,10 +24,10 @@ import salome from salome.kernel.studyedit import getStudyEditor from study import ParametricStudy -job_script_template = """ -#!/usr/bin/env python +job_script_template = """#!/usr/bin/env python import salome +from salome.kernel.studyedit import getStudyEditor import PARAMETRIC salome.salome_init() @@ -35,8 +35,12 @@ salome.salome_init() # load study study = salome.myStudyManager.Open("%(input_study)s") -# start container and load PARAMETRIC component -comp = salome.lcc.FindOrLoadComponent("ParametricContainer", "PARAMETRIC") +# start container, load PARAMETRIC component and load the content of the parametric study in the component +ed = getStudyEditor(study._get_StudyId()) +sobj = study.FindObjectID("%(param_entry)s") +scomp = sobj.GetFatherComponent() +ed.loadComponentEngine(scomp, "ParametricContainer") +comp = scomp.GetObject() # run parametric study comp.RunStudy(study._get_StudyId(), "%(param_entry)s") -- 2.39.2