2013-02-12 17:35:16 +06:00
|
|
|
# Using SALOME NoteBook
|
|
|
|
|
|
|
|
import salome
|
2013-04-04 13:06:43 +06:00
|
|
|
salome.salome_init()
|
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 14:57:14 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-02-12 17:35:16 +06:00
|
|
|
import salome_notebook
|
|
|
|
gg = salome.ImportComponentGUI("GEOM")
|
|
|
|
|
|
|
|
# set variables
|
|
|
|
notebook = salome_notebook.notebook
|
|
|
|
notebook.set("Length", 150)
|
|
|
|
notebook.set("Width", 100)
|
|
|
|
|
|
|
|
# create box
|
|
|
|
box = geompy.MakeBoxDXDYDZ("Length", "Width", 200)
|
|
|
|
|
|
|
|
# add object in the study
|
|
|
|
id_box = geompy.addToStudy(box,"Box")
|
|
|
|
|
|
|
|
# display the boxes
|
|
|
|
gg.createAndDisplayGO(id_box)
|
|
|
|
gg.setDisplayMode(id_box,1)
|