I’m looking into debugging GhPython scripts in Visual Studio. This works, except problems in identifying the file that holds the executed script. The problems are expected as GhPython does not get a file name and then execute that file, but rather it gets a string and when executing this script the debugger has not way to get information on the file containing the script. Visual Studio reports a ‘Source not available, frame not in module’ error and debugging is not really possible.
I see two ways to fix this: manually specify the file (that possible in Eclipse, VS does not seem to offer this possibility) or fix GhPyhton.
The later seems to be easy at first glance, as the PythonScript class offers a ExecuteFile() metod. If I execute a script using this method the debugger can identify the file. But I don’t see a way to get access to the GhPython inputs and outputs? PythonScrip provides the necessary methods to setup the scope for the script properly, but ExecuteFile() does not run the script in that scope (this probably makes sense usually, but not here).
So, and ideas to resolve the issue?
PS: A workaround is to write a small GhPython script that imports the script to be debugged but I find that not very elegant.