FIX: Resolve all paths to absolute before passing to NX

Root cause: Path.absolute() on Windows does NOT resolve '..' components.
sim_file_path was reaching NX as '...\studies\01_doe_landscape\..\..\models\Beam_sim1.sim'
NX likely can't resolve referenced parts from a path with '..' in it.

Fixes:
- nx_interface.py: glob from self.model_dir (resolved) not model_dir (raw)
- solver.py: sim_file.resolve() instead of sim_file.absolute()
- solve_simulation.py: os.path.abspath(sim_file_path) at entry point
- Diagnostic logging still in place for next run
This commit is contained in:
2026-02-11 15:24:20 +00:00
parent 55f0f917c7
commit 80104d2467
19 changed files with 3445 additions and 8 deletions

View File

@@ -209,8 +209,9 @@ def main(args):
name, value = arg.split("=", 1)
expression_updates[name] = float(value)
# Get working directory
working_dir = os.path.dirname(os.path.abspath(sim_file_path))
# Resolve ALL paths to absolute — NX can fail silently with ".." in paths
sim_file_path = os.path.abspath(sim_file_path)
working_dir = os.path.dirname(sim_file_path)
sim_filename = os.path.basename(sim_file_path)
print(f"[JOURNAL] " + "=" * 60)

View File

@@ -414,7 +414,8 @@ class NXSolver:
# Create a custom journal that passes the sim file path, solution name, and expression values
# Build argv list with expression updates
argv_list = [f"r'{sim_file.absolute()}'"]
# MUST use resolve() not absolute() — absolute() doesn't resolve ".." on Windows
argv_list = [f"r'{sim_file.resolve()}'"]
# Add solution name if provided (passed as second argument)
if solution_name: