Grasshopper to Speckle automation

Hi Team,

I have a Rhino3d appserver running on Heroku and a compute server on EC2 which is working well. If I run the Grasshopper tool on the compute server and add a ‘send’ stream to Speckle in the flow that also works and I see the changes replicate in Stream.

What I want to be able to do is call the grasshopper definition via the API and then that either send me a speckle compatible output back which I can then connect with a speckle stream, or if its possible to configure the definition to send it directly that would be ok. I’m also trying to use parameters so it’s possible to configure the speckle stream as part of the integration flow to support multiple streams.

Any thoughts on how to do this?

Hey Matt,

I’m not very familiar with Rhino compute, but if its API offers any sort of remote trigger, then you can use the Send Async component to automatically send to a stream:

Is that what you were looking for?

Hi there @waveworksmatt!

Just to add to @teocomi answer:

This may be tricky, as far as I’m aware running Grasshopper definitions in Rhino.Compute has a limitation on what types of output you can send (basically, just text, geometry, numbers…) but it’s not possible to output “speckle data” or data from any other plugin for that matter.

It is possible to write the objects to JSON and return that, but the result have a huge size so I wouldn’t recommend this approach.

This would be our recommended approach (as Matteo indicated). There’s a couple gotchas there as you’ll have to use the Send/Receive Sync components instead of the ones that have buttons (the “normal” Send/Receive nodes).

You may want to activate your Dev components inside the Speckle 2->Tabs menu.

This will show you some extra advanced components designed specifically for compute. The one you’re looking for is:

  • Get account from token: Allows you to fetch an account based on an input stream and authToken. The token can be passed in as one of the parameters of the GH definition.

Once you have that account, you can pass it through a GetStream component to attach the account to be used on a specific stream.
Any component using that output url will use that same user. You’ll notice the output url would contain a ?u=USER_ID prefix at the end :wink: