THE INFAMOUS SPAGHETTI

Organizing Grasshopper Scripts

WHY WE NEED A COLLECTION OF GOOD PRACTICES

Kaushik
MODFIVE Labs

--

Ever since my initial years of using Grasshopper, one of the things I find myself struggling with, is the infamous spaghetti script. Now, now, settle down, … I don’t have anything against the amazing Italian dish. I’m only talking about the ones I usually come across on the McNeel forums, or that important file from my classmate / colleague or even from myself while playing around with my new (sometimes brilliant) ideas.

A super-messy grasshopper file. A.K.A the spaghetti script.
The Spaghetti Script — Breakfast as usual

Having to trace connections, untangle wires and then try to understand how the components works, every time we need an example file surely feels like too much hassle. Wouldn’t life be better if we could spend the time actually learning the skill instead of navigating through the spaghetti-script? We all tend to get carried away while working, (i do that too) and forget the fact that other people might have to see and understand our work too. While none of us are to blame, let us try to find a solution.

A few users have shared their concerns on the McNeel Forum

“We are trying to find ways to create structured files that are easy on our eyes…

Upon casually searching online, I was pleased to know that I am not alone. As a matter of fact, this is one of the rarely discussed (but highly important) problems in the Grasshopper community. We are trying to find ways to create structured files that are easy on our eyes (and our stomachs). While there are a few 3rd party plugins that help us in this ambitious quest, I personally prefer using the existing(native) tools and settings to try to achieve our goal.

Here’s why — ORGANIZING IS THE WAY FORWARD…

  1. For Yourself: Easily find what you’re looking for, make changes, debug and re-use parts of scripts. Create once, Reuse later.
  2. For your Workplace: Your colleague(who prefer pancakes) doesn’t have to eat spaghetti every time you send them one. Time can be spent on creating solutions, instead of sorting out the mess. Time is Money.
  3. For the Community: A well-structured file can serve as an example in a multitude of ways. New users can benefit with a quicker learning pace, more number of people are persuaded to try to answer your queries, and you set an example of good practices -which all of us can learn from.
  4. For Non-Users: A structured file helps break the stereotype — ”Grasshopper is hard, and has a lot of wires that don’t make sense.” This could also potentially entertain new people to start using Grasshopper, and expand the community.
  5. For Me: Helps me prove a point — I am not going all OCD with arranging the components and wires.

Disclaimer: No Italians were harmed in the making of this article.

--

--

Kaushik
MODFIVE Labs

I’m an Architect, Programmer and a DIY aficionado, on a mission to automate boring tasks in the AEC industry.