Connecting Grasshopper & VIKTOR apps

Stijn Jansen

by Stijn Jansen

In this blog, we’ll tackle a common issue engineers and designers face: keeping collaboration smooth when working with complex geometric data. Traditional methods often lead to data loss or require clunky file conversions, which can slow everything down. If you're a structural engineer, architect, or parametric designer using Grasshopper, you’ve probably experienced this frustration. The good news? By integrating VIKTOR directly into Grasshopper nodes, you can push and pull data effortlessly, avoiding data loss and speeding up your workflow. Let’s dive in and see how this solution works in practice!
Download the white paper and get INSPIRED

Learn how collaborative parametric design models allow you to work together for better solutions.

Pushing and pulling data with VIKTOR’s Grasshopper worker

A great way of automating your Grasshopper scripts is by integrating them into your applications. There's just one downside to this: you cut out the Grasshopper user from the workflow. Overall, this is not an issue in mature design phases where the script was set. However, this is different for cases in which a Grasshopper script is still subject to change. Or whenever the model used in a VIKTOR application needs to be updated through a change in Grasshopper. No worries, because we created a solution to this: Grasshopper nodes, which you can use to let users on both sides of the flow push, pull and run analysis on data.

Keep reading for some examples, including the download files to use in your own apps!

Pull information from a VIKTOR app into Grasshopper

Thanks to the VIKTOR API, we can now, using a Grasshopper node, retrieve information from a VIKTOR application in Grasshopper. This information can be anything. In the example video below, you can see that we are retrieving the bridge deck geometry from the VIKTOR application and are able to use it in Rhino and Grasshopper for further analysis or design. When we update and save the bridge deck, we can simply recompute it, and the latest geometry is loaded.

Download the Grasshopper file used for this example here.


Push data from Grasshopper to VIKTOR for visualization

Similarly to pulling data from a VIKTOR app into Grasshopper, we can just as simply push Grasshopper data back into an app.

In this example, we are pushing data for dashboarding. Dashboarding is one of the weak features of Grasshopper. Therefore, we want to push the data to VIKTOR to dashboard it there instead. In VIKTOR, we can use the power of Python and Plotly to make a custom and interactive dashboard of the latest model.

In this example, we parametrically design a roof structure and push the data to VIKTOR. The VIKTOR application then calculates lengths, volumes and the expected carbon footprint of the structure!

Download the Grasshopper file used for this example here.


Run complex analyses on Grasshopper data

In some cases, the designer may require information that is stored in VIKTOR. In this case, you can use VIKTOR compute to run an analysis and use the VIKTOR application as the calculator for your Grasshopper script.

In this next example, we have a simple application that uses a VIKTOR app to calculate the cost and carbon footprint of the beam. Using this app, you can make more complex calculations in Grasshopper than before! Additionally, it introduces many options for optimization in Grasshopper.

Download the Grasshopper file used for this example here.


Push geometry from Grasshopper into VIKTOR and perform analyses

Although this fourth example may seem similar to the second example, pushing data and pushing geometry are done slightly differently. In this example, we are showing that the user of the VIKTOR application (in this case a structural engineer) can perform an analysis using OpenSeesPy – a finite element package designed for structural engineering.

In this application, the user creates the model using the grid in Grasshopper and pushes it to the VIKTOR application. In the VIKTOR application, the load case is added to the geometry and OpenSees creates a beautiful visual of the displacements. Updating the model takes just a few seconds!

Download the Grasshopper file used for this example here.

You can also find the full application here.


What's coming next?

These examples pave the way for many more features. As more examples and use cases are realized, we work towards creating even more seamless, collaborative tools for Grasshopper users and other domain experts. Want to try Grasshopper and VIKTOR yourself? Join our community and start building your own custom web apps today!

Download links:

illustration of start now

Start building apps for free

Start now
Share

Related Blog Posts

6 Ways to improve your SAP2000 and ETABS workflows

Read more

How to use Python to automate SAP2000

Read more

Tables in Python made easy for engineers with Pandas

Read more
Get our best content in your inbox

Subscribe to our newsletter and get the latest industry insights

Customer Cases

Blog Posts

White Papers & Guides