if DEMO_IS_ACTIVATED:
# Check that GEOM and SMESH modules are present
try:
- import geompy, smesh
+ import GEOM
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
+
+ import SMESH, SALOMEDS
+ from salome.smesh import smeshBuilder
+ smesh = smeshBuilder.New(salome.myStudy)
except:
DEMO_IS_ACTIVATED = False
import salome
def trihedron(context):
- import geompy
+ import GEOM
+ from salome.geom import geomBuilder
# Intialize the geompy factory with the active study
activeStudy = context.study
- geompy.init_geom(activeStudy)
+ geompy = geomBuilder.New(activeStudy)
# Create the objects
Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
# -------------------------------------------------------------------------
# Example 1 bis: creation of basic objects and automatic display
def trihedron_withdisplay(context):
- import geompy
+ import GEOM
+ from salome.geom import geomBuilder
# Intialize the geompy factory with the active study
activeStudy = context.study
- geompy.init_geom(activeStudy)
+ geompy = geomBuilder.New(activeStudy)
# Create the objects
Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
#
# Intialize the geompy factory with the active study
-import geompy
import salome
-geompy.init_geom(salome.myStudy)
+
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
# Create the objects
Vx = geompy.MakeVectorDXDYDZ(10, 0, 0)
def createMesh(study, shape):
'''This function creates the mesh of the specified shape on the specified study'''
print "TUBE: creating the mesh ..."
- import smesh
+ import SMESH
+ from salome.smesh import smeshBuilder
+ smesh = smeshBuilder.New(study)
- smesh.SetCurrentStudy(study)
mesh = smesh.Mesh(shape)
Regular_1D = mesh.Segment()
Nb_Segments = Regular_1D.NumberOfSegments(10)