Need help with Tutorial - Integrate Rhino/Grasshopper

I am currently working through your Grasshopper tutorial

(Tutorial - Integrate Rhino/Grasshopper | VIKTOR Documentation)

and have encountered a challenge in the final step - connecting my application to a Rhino Compute Server. I’ve successfully navigated through the previous steps, including setting up the worker and Rhino Compute.

However, I am facing an issue in the last part, specifically the
“Optional: Connect your app to a Rhino Compute Server” section.

Despite configuration, including verifying the URL and API_KEY, I am not seeing the expected results on my screen. The only error message I receive from Rhino Compute is related to ‘wrong data on root level’, but the specifics of this error are unclear to me.

Here are some details about my setup:

  • Python Version: 3.10.11
  • Viktor Version: 14.6.1

Could you please provide guidance on what might be causing this issue and how to resolve it? Any insights or troubleshooting steps would be greatly appreciated.

Thank you for your help.

Hi Solkyu,

Great to see you are building a VIKTOR app with a Grasshopper integration!

To connect your VIKTOR app to Grasshopper, we have described to methods in our documentation.

  1. The first method is easiest if you want to connect your app to Grasshopper on your local machine and you already have Rhino/Grasshopper installed. This first method uses the Hops plugin and a generic worker and does not require you to setup Rhino Compute setup or API key. You can find the documentation here.
  2. The second method is more scalable and is best suited to setup on a remote server. For this method you need to setup Rhino Compute server manually. This method is documented here.

It is not entirely clear to me which of these two methods you followed. For development purposes I would advise to start with method 1. Could you try to follow the steps of the documentation above?

Let me know if you run into any issues!

Hi! Thank you for your prompt reply. It is the second method that i find it not working at the moment. Alrhough it seems like i have managed to follow along and there isbno clear error message, yet the app does not visualize grasshopper on viktor…

Hi Solkyu,

The Python code for the second method is slightly different from the first. Did you make sure to follow the Python example in the documentation of the second method?

From your screenshots it looks like the request is never received by the Rhino Compute server. Are you running the Rhino Compute instance on your local machine? If this is the case, maybe you could try to first access the Rhino Compute server from a local Python script, before accessing it from your VIKTOR app in order to make sure that the connection is successful. Also, in this case keep in mind that if you publish your app, the app code cannot access the local Rhino Compute server. For production purposes you should setup a remote server (or go with method 1).

1 Like

You were absolutely right… Regarding the connection issue,
It appears that my requests weren’t reaching the Rhino Compute server.

I’ve realized that a license for Rhino Compute is required. I’m currently in the process of obtaining this license from our company. As soon as I have it, I’ll be able to proceed with the next steps and hopefully resolve the issue.

I really appreciate your help and guidance on this matter. I’ll keep you updated and reach out again once the license is in hand and the issue has been resolved.

1 Like

Dear Team,

I am currently developing an application using Rhino.Compute as a local server to run Grasshopper scripts. To overcome port forwarding issues from company network, I utilized Ngrok for externally exposing the API. In the development environment, everything functions correctly – Grasshopper operates as expected using both the Ngrok link and localhost:6500.

However, I am facing a challenge when publishing the application. In the published mode, Grasshopper does not execute as it does in the development environment. This issue leads me to suspect that there might be a change in the URL or some other configuration alteration that occurs during the transition from development to publish mode.

Here is a screenshot capturing the issue: Grasshopper Issue in Published Mode

Could you please assist in identifying the following:

  1. Does change the URL or any relevant configurations when an app transitions from development to publish mode?
  2. Are there any specific settings or adjustments needed for a seamless transition, especially considering the use of external tools like Ngrok and Rhino.Compute?
  3. Any insights or suggestions you might have based on similar issues encountered by other users?

Just a quick check for low hanging fruit: did you assign the required worker to the workspace of your published app as well?
And if so, can you see jobs coming in on that worker’s logs when trying to run the app in the published version?

1 Like

that was it! although the update button sometimes works and sometimes doesn’t, it works!