API to EditPythonScript at a given location

Hi there,

I am writing a C# rhino common plugin which generates python code.
I would like to show the generated python code in Rhino’s EditPythonScript dialog and benefit from its syntax highlighting and code completion features.

Is there a way to programmatically instruct the EditPythonScript command to open a given file, e.g.
EditPythonScript “/the/python/file/which/i/generated.py”.

So far I only managed to open a file in EditPythonScript with user interaction via “File - Open”.

Many thanks for your reply.
Cheers.

Hi @Andrin,

The EditPythonScript command doesn’t have an option for doing this. But it seems like a reasonable request.

https://mcneel.myjetbrains.com/youtrack/issue/RH-69369

Note, the editor is being overhauled for Rhino 8. So if this issue is worked on, this is where you’d see it.

Thanks,

– Dale

1 Like

RH-69369 is fixed in the latest WIP