]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
importPolylines must work with only one polyline in shape
authorPaul RASCLE <paul.rascle@openfields.fr>
Mon, 31 Aug 2020 09:19:27 +0000 (11:19 +0200)
committerYOANN AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Fri, 30 Oct 2020 16:06:22 +0000 (17:06 +0100)
src/HYDROTools/hydroGeoMeshUtils.py

index 990dd9c477e20ec1ea9253e89267316953d5ea99..e23d44c61b874cb135010de18850894635b3840a 100644 (file)
@@ -35,7 +35,14 @@ def importPolylines(document, shapeFile, shapeName, iSpline, displayLevel):
         shapeType = 1 # polyline
     shapes = []
     isShapeFound = True
-    index = 0
+    shape = document.FindObjectByName(shapeName) # single shape
+    if shape is not None:
+        for i in range(shape.NbSections()):
+            shape.SetSectionType(i, shapeType)
+            shape.Update()
+            shape.SetZLevel( displayLevel )
+        shapes.append(shape)    
+    index = 0  # for multiple shapes
     while isShapeFound:
         shapeNameIndex = shapeName + "_%d" % index
         index = index + 1