Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Speckle-Compute

Automate AEC workflows using Webhooks with Speckle.

Usage

The project template to deploy a Speckle<-->Rhino.Compute workflow and all of the documentation necessary to cook this cake.

Speckle_Compute

The example in this project uses Speckle to panellise a Wall according to custom Revit parameters that control a Grasshopper definition running on rhino-compute.

To test it, follow the instructions below.

Requirements

  • Revit 2023/2024/2025
  • Speckle server / account
  • A deployed Rhino Compute Server
  • A Fly.io account

Revit

Speckle Revit Plug-in Installed.

Speckle Server

A bot account and its token. I have already deployed a "computebot" that we can all use. After adding it as a collaborator, ask me to accept the invitation to the projects in which you want it to be able to read / write.

Middleware

Fly.io account - https://fly.io/docs/

Rhino Compute

Install Lunchbox plug-in (or any required to run your gH definition).

Instructions

Project Setup

Grasshopper

Use example.ghx as a template. Always save as .ghx

Make sure the name of the Revit parameters you use match the ones existing in your Revit file.

Python

  1. Clone this repo
  2. Replace example.ghx with your own .ghx script.
  3. Change fetch.py to point to your own Speckle Projects and gHscript.
  4. Generate requirements.txt
    1. pip install pipreqs and then pipreqs <your-project-dir>

Fly.io

Install

  1. Install fly

    brew install fly (mac)

    powershell -Command "iwr https://fly.io/install.ps1 -useb | iex" (windows)

  2. Authenticate to your account: fly auth login

Deploy

  1. in terminal:cd <your-project-dir>
  2. fly launch
    1. pick app name
    2. choose region
  3. Use the fly.toml file provided in this repo (simply change the app name in the beggining to match your own) or make the following changes to the autogenerated file:
    1. kill_signal = "SIGUSR1”
    2. kill_timeout = 300
    3. before [env], place:
      1. [build] builtin = "python" [build.settings] pythonbase = "3.9-slim-buster"
    4. [env] PORT = "8080"
  4. Deploy your app - fly deploy
  5. Wait until deployed successfully

Speckle

  1. Create two Projects and add computebot (computation@iaac.net) as a collaborator:
    1. Where you will send your geometry: Send_to_Compute
    2. Where you will receive your geometry: Receive_from_Compute
  2. In Send_to_Compute go to Webhooks>New Webhook:
    1. URL: https://<your-app-name>.fly.dev/webhook
    2. Events: version_create

Revit

  1. Use the example Project1.rtv or create your own Revit file, don´t forget to create the shared parameters that your gH definition will reference. In this example:

    1. xdir = Float
    2. ydir = Float
  2. Set Receive_from_Compute to Auto-Receive if you want to see updates from Rhino.Compute in real time.

  3. Send your geometry (with parameter information!) to Send_to_Compute

    demo

Debugging

It is reccomended that you run tests locally before attempting to deploy to Fly. The simplest way to check if yout gH script is properly setup is to edit it and have it run with an Auto-Receive and an Auto-Send (this will mimick the behavior of the compute server). Make sure Auto-Receive is getting its data from the Send_to_Compute Project, and Auto-Send is connected to Receive_from_Compute. If your webhook is property setup, this script will trigger a new commit everytime you send new data do Send_to_Compute.

If this works well, then you need to debbug the Fly-side. Log in to the platform, go into your App Dashboard and check the Logs. You will see print statements that match the ones in main.py.

Las but not least, you can always use ngrok as a webhook mirror to your apps local address and run Rhino.Compute locally.

  1. In terminal: ngork http http://0.0.0.0:8080
  2. Set your Speckle webhook URL as http://<your-given-hash>.ngrok.io/webhook

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages