Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

RhinoApp.RunScript() is not working on separate thread

$
0
0

Hello!

I am trying to run a Rhino.RhinoApp.RunScript() in Python3 for Rhino8 from a seperate thread with:

import Rhino
import threading

def my_func(file_path):
    result : bool = Rhino.RhinoApp.RunScript(f"-_ScriptEditor Run {py_file} ", True)
    Rhino.RhinoApp.WriteLine(f"result of command: {result}")

if __name__ == "__main__":
    thread = threading.Thread(target=my_func, args=("F:/my_file_path"))
    thread.start()

The function runs and compiles but the result is always False. Yet, if I run RhinoApp.RunScript() on main no problem.

Somebody know what am I missing on the thread?

Thanks!

7 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles