[Python] How to run a tNavigator simulation using Python (not just launch the GUI)?

Discussão em 'Python' iniciado por Stack, Junho 25, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to automate the simulation process in tNavigator using Python. So far, I can launch the tNavigator GUI using the provided Python API, but the simulation does not actually start running.

    [​IMG]

    import subprocess
    import time
    import pyautogui

    exe_path = r"D:\tNavigator\t-navigator22.4\tNavigator-22.4.exe"
    model_path = r"D:\tNavigator\Project\IP14_CO2\IP14_E300.DATA"
    run_btn_image = "run_button.png"

    subprocess.Popen([exe_path, model_path])
    time.sleep(15)

    location = pyautogui.locateCenterOnScreen(run_btn_image, confidence=0.85)
    if location:
    pyautogui.moveTo(location)
    pyautogui.click()
    print("✅")
    else:
    print("❌")


    I want to automatically run the simulation (not just open the project in tNavigator).

    Ideally, I also want to:

    Wait for the simulation to finish,

    Check if it completed successfully,

    Extract results (e.g., RSM file path, summary output).

    Thanks in advance!

    Continue reading...

Compartilhe esta Página