From: Renaud Barate Date: Thu, 25 Apr 2013 15:28:27 +0000 (+0200) Subject: Fix bug on PARAMETRIC component loading in batch X-Git-Tag: V7_2_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fc67151dbfab0f3d607e5c64148990eda59bfded;p=modules%2Fparametric.git 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. --- 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")