From 51bbc61dda3ea4349d40b480c827693ba52c83d6 Mon Sep 17 00:00:00 2001 From: Jan Kleinert Date: Tue, 26 May 2020 10:41:49 +0200 Subject: [PATCH] dont try to convert nonexistent guide curves, fixes #18 --- cpacs2to3/convert_coordinates.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpacs2to3/convert_coordinates.py b/cpacs2to3/convert_coordinates.py index 1bd31d1..2f1a26d 100644 --- a/cpacs2to3/convert_coordinates.py +++ b/cpacs2to3/convert_coordinates.py @@ -195,6 +195,8 @@ def find_guide_curve_using_profile(tixi2, profileUid): nSegments = tixi2.getNumberOfChilds(xpathSegments) for segmentIdx in range(0, nSegments): xpathGuideCurves = xpathSegments + '/segment[{}]/guideCurves'.format(segmentIdx + 1) + if not tixi2.checkElement(xpathGuideCurves): + continue nCurves = tixi2.getNumberOfChilds(xpathGuideCurves) for curveIdx in range(0, nCurves): xpathGuideCurve = xpathGuideCurves + '/guideCurve[{}]'.format(curveIdx + 1)