Can't use shaper python code in yacs inline script node

I can’t use shaper python code in yacs inline script node. I creat a box in shaper and dump python code use salome.and i copy paste it into yacs it doesn’t work .but i use it in python consol it works. i don’t konw why.

#!/usr/bin/env python

###
### This file is generated automatically by SALOME v9.11.0 with dump python functionality
###

import sys
import salome

salome.salome_init()
import salome_notebook
notebook = salome_notebook.NoteBook()
sys.path.insert(0, r'C:/')

###
### SHAPER component
###

from salome.shaper import model

model.begin()
partSet = model.moduleDocument()

### Create Part
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()

### Create Box
Box_1 = model.addBox(Part_1_doc, 10, 10, 10)

model.end()

###
### SHAPERSTUDY component
###

model.publishToShaperStudy()
import SHAPERSTUDY
Box_1_1, = SHAPERSTUDY.shape(model.featureStringId(Box_1))

if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser()


occured error.
but!!!when i use the code in python consol it works!

I encounter the same problem, and I think the problem is in the shaperstudy. I tried to make an export to .xao format before the ‘model.publishToShaperStudy()’ which seams to work. I’m then able to import it back to the geom module, but only if I do the process manually, impossible to automatise with yacs( it gives only a unit vector if it don’t crash, maybe the .xao file is partially corrupted I don’t know)
If you have found a way to overcome this it would be a huge help