I had an external app that called a grasshopper user object in order to export some geometry & data based on different inputs. This was working ok in Rhino 7 but now I am working in Rhino 8, it just does not work. Is there no support for GH Python Remote in Rhino 8??
My python script (external) was something like this:
where user-object was the name of a saved user object and x1, x2 … the inputs to the user object.
The error I am getting if trying in Rhino 8 is “no module named ghpythonremote”
Any help to make this work in Rhino 8?
Have you installed GHPythonRemote in Rhino 8? You need to give it an explicit path during the installation step, the latest version will only look for Rhino 7 installations and earlier:
If there is any error at the end of this step, it is not fully installed and will likely not work.
In general, all of this should still work in Rhino 8 just like it worked in Rhino 7, but I only provide very limited support at this point. There are better ways of calling Rhino and Grasshopper functions from Python in version 8, including Rhino.Compute and Rhino.Inside CPython.
Going through the installation instructions and adapting for Rhino 8, I can run all of the example file CPython_to_GH.py. That includes calling a User Object and getting its result (15 here).
(ghpyremote) pierre@PierreProArt16:/$ python "C:\Users\pierre\AppData\Roaming\McNeel\Rhinoceros\8.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\gh-python-remote\examples\CPython_to_GH.py"
INFO: ghpythonremote.connectors:
Connecting...
DEBUG: ghpythonremote.connectors:
Connecting. Timeout in 60 seconds.
DEBUG: ghpythonremote.connectors:
Connecting. Timeout in 59 seconds.
DEBUG: ghpythonremote.connectors:
Connecting. Timeout in 58 seconds.
DEBUG: ghpythonremote.connectors:
Connecting. Timeout in 57 seconds.
DEBUG: ghpythonremote.connectors:
Found connection, testing. Timeout in 56 seconds.
DEBUG: ghpythonremote.connectors:
Found connection, testing. Timeout in 55 seconds.
DEBUG: ghpythonremote.connectors:
Found connection, testing. Timeout in 54 seconds.
DEBUG: ghpythonremote.connectors:
Found connection, testing. Timeout in 53 seconds.
DEBUG: ghpythonremote.connectors:
Found connection, testing. Timeout in 52 seconds.
DEBUG: ghpythonremote.connectors:
Connection ok, returning.
INFO: ghpythonremote.connectors:
Connected.
8958.4515789
15
INFO: ghpythonremote.connectors:
Closing connection.
INFO: ghpythonremote.connectors:
Closing Rhino.
Note the changes in that example file provided with the GH Python Remote installation:
line 30: rhino_ver=7 to rhino_ver=8
line 59: rghuo.TestClusterGHPythonRemote to rghuo.TestClusterGHPR
I also had to install the test User Object from %APPDATA%\McNeel\Rhinoceros\8.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\gh-python-remote\examples\TestClusterGHPR.ghuser to the Grasshopper User Objects folder.
Please let me know if you get stuck somewhere with your scripts, tell me how you got there, and I’ll see if I can fix that.