Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Using SALOME NoteBook

1 # Using SALOME NoteBook
2 
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 import salome_notebook
9 gg = salome.ImportComponentGUI("GEOM")
10 
11 # set variables
12 notebook = salome_notebook.notebook
13 notebook.set("Length", 150)
14 notebook.set("Width", 100)
15 
16 # create box
17 box = geompy.MakeBoxDXDYDZ("Length", "Width", 200)
18 
19 # add object in the study
20 id_box = geompy.addToStudy(box,"Box")
21 
22 # display the boxes
23 gg.createAndDisplayGO(id_box)
24 gg.setDisplayMode(id_box,1)

Download this script