From: Paul RASCLE Date: Mon, 31 Aug 2020 09:19:27 +0000 (+0200) Subject: importPolylines must work with only one polyline in shape X-Git-Tag: SH_V2_2_0~59 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4336af225f0628701bd6ff831053e554af43a8e;p=modules%2Fhydro.git importPolylines must work with only one polyline in shape --- diff --git a/src/HYDROTools/hydroGeoMeshUtils.py b/src/HYDROTools/hydroGeoMeshUtils.py index 990dd9c4..e23d44c6 100644 --- a/src/HYDROTools/hydroGeoMeshUtils.py +++ b/src/HYDROTools/hydroGeoMeshUtils.py @@ -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