From a4336af225f0628701bd6ff831053e554af43a8e Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 31 Aug 2020 11:19:27 +0200 Subject: [PATCH] importPolylines must work with only one polyline in shape --- src/HYDROTools/hydroGeoMeshUtils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.39.2