Read geometry from 3dm file through grasshopper deffinition

Hi,
Im working on app with grasshopper worker where are some inputs from 3dm file - layers. I red topics in community which are talking about this but its very complicated for me. I found that there is two ways to achieve it: use generic worker or use HOPS Get Geometry component to read external geometry from 3dm file. This is my grasshopper deffinition:

app.py is base example code from manual with changed grasshopper deffinition name. When I try to start application compute.rhino3d component dont get any error. But on VIKTOR worker side process ends with time out error:

2025-04-16 11:09:09 INFO Received (1) job_pointer: 1207193
2025-04-16 11:09:09 INFO Executing Grasshopper script on RhinoCompute server (http://localhost:6500/)
2025-04-16 11:09:39 INFO Stopping job with UID 1207193
2025-04-16 11:09:39 ERROR TIMEOUT_ERROR: Stopped job successfully after timeout
2025-04-16 11:09:39 INFO Sending result_pointer: 1207193

Console of app says:
Traceback (most recent call last):
File “viktor_connector\connector.pyx”, line 296, in connector.Job.execute
File “viktor\core.pyx”, line 2055, in viktor.core._handle_job
File “viktor\core.pyx”, line 2038, in viktor.core._handle_job._handle_view
File “viktor\views.pyx”, line 2518, in viktor.views.View._wrapper
File “C:\appsviktor\sample-box-grasshopper\app.py”, line 38, in run_grasshopper
analysis.execute(timeout=30)
File “viktor\external\external_program.pyx”, line 414, in viktor.external.external_program.ExternalProgram.execute
TimeoutError: Timeout: external analysis has taken longer than 30 seconds

Is problem with my .gh deffiniton (printscreen), app.py code remains something - read and encode geometry etc… (its as documentation example - grasshopper integration) or data are very large? This two layers in 3dm file are around 180 MB.

Hi @Marian ,

To help you out better; could you try to create a new Grasshopper canvas with a Hops component (

← this one). Then reference your script (as shown in the image above) in that Hops component.

This should run, and take some time. Could you verify that this setup:

  • Succesfully creates the geometry
  • Takes less than 30 seconds

Kind regards, Rick

Hi Rick,
thank You for your answear. I made some tests with .gh deffinition from printscreen only on Rhino side with HOPS component. I dont know if I used HOPS component in right way, but on compute.rhino3d component appeared this message:

[11:48:34 ERR] HTTP POST /grasshopper responded 500 in 41.7723 ms
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request body too large. The max request body size is 52428800 bytes.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.OnReadStarting()
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.TryStartAsync()
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.ReadAsyncInternal(CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask1.GetTaskForValueTaskSource(IValueTaskSource1 t)
— End of stack trace from previous location —
at System.IO.Pipelines.PipeReaderStream.ReadInternal(Span`1 buffer)
at System.IO.Pipelines.PipeReaderStream.Read(Byte buffer, Int32 offset, Int32 count)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadToEnd()
at rhino.compute.ReverseProxyModule.SendProxyRequest(HttpRequest initialRequest, HttpMethod method, String baseurl) in C:\dev\github\mariankolpak\compute.rhino3d\src\rhino.compute\ReverseProxy.cs:line 142
at rhino.compute.ReverseProxyModule.ReverseProxyGrasshopper(HttpRequest req, HttpResponse res) in C:\dev\github\mariankolpak\compute.rhino3d\src\rhino.compute\ReverseProxy.cs:line 202
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)

It seems, that size of request is too large. If the problem is not elsewhere.

Hi @Marian ,

It seems indeed that the input you are providing is quite large. Rhino.Compute has a default value of 50MB, but this value can be changed. You will need to set a environment variable called RHINO_COMPUTE_MAX_REQUEST_SIZE on the machine (and restart Rhino).

More info here: Hops error: Request body too large - #5 by AndyPayne - Hops - McNeel Forum