From 0ea42e88ce7bade644b2d3fa076f5788e7a3e2c4 Mon Sep 17 00:00:00 2001 From: fandaL Date: Tue, 4 Oct 2016 09:43:32 +0200 Subject: [PATCH] FEM: fix in inp reader, include relative path --- src/Mod/Fem/importInpMesh.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Fem/importInpMesh.py b/src/Mod/Fem/importInpMesh.py index 456b85d8a..183042401 100644 --- a/src/Mod/Fem/importInpMesh.py +++ b/src/Mod/Fem/importInpMesh.py @@ -77,7 +77,13 @@ def read_inp(file_name): if line[:8].upper() == "*INCLUDE": start = 1 + line.index("=") include = line[start:].strip().strip('"') - f_include = pyopen(include, "r") + include_path = os.path.normpath(include) + if os.path.isfile(include_path) is True: + f_include = pyopen(include_path, "r") + else: + path_start = os.path.split(file_name)[0] + include_full_path = os.path.join(path_start, include_path) + f_include = pyopen(include_full_path, "r") continue read_node = False elm_category = []