From a Grasshopper definition to a Windows application

I am in a very particular situation.
I’ve been developing, let’s call it, an app with Grasshopper and Rhino.
It’s configurable GUI with a control panel, that produces certain 2D elements.

I’ve made it completely through Grasshopper and then again, compiled a UI with Human UI for the client.
The “app” is controllable and working both as a standalone definition within the Rhino Viewport and with the Human UI also. I’ve basically made it twice.

You basically make custom buttons in a grid that have specified inputs that, together, make 2D linework.

Now, the client wants this “app” to be converted as a Windows app, that he could deploy throughout their firm’s system and not live in the Rhino ecosystem.

I’m sorry that I cannot upload anything related to this project.

My question is - How would you go about, exporting the code to be further developed and compiled as a working Windows application?

1 Like

The “not live in the Rhino ecosystem” seems problematic to me.

I’m no expert at all, but I guess that this would probably entail to re-code every single “functionality” that Rhino offers and that you use in your script, starting from zero, or near zero. You would also probably need to depart from visual scripting (grasshopper) and use “old school” coding (C#, Python, C++, etc.).
Most of these languages offer some libraries of their own that could come in handy for 3D visualisations and calculations, for maths, for UI development (user interface) and so on.
Departing from the Rhino ecosystem would probably mean that you couldn’t rely on Human UI anymore, since it probably relies heavily on the Rhino API itself.

Take all this with a grain of salt, but in my opinion, this is very unlikely to be achieved.

One option would be to give Processing a go. It is open and free, and handles 2d and 3d rather well. There are other limitations though and it is purely text-based scripting in Java, I believe.

1 Like

It’s exactly what I figured. I have never seen a way to get a definition to be exported as is and build on top of it.
Yea, even tho I know my way around Grasshopper and Rhino, I’m not really that proficient in the complete technical stuff behind the scenes.

I was hoping there was a way to do it, and not start from scratch but reuse, at least the mechanics.

But imagine if this would be possible. Rhino + Grasshopper would be the perfect tool to build UIs and connect the code with the back-end of the application.

1 Like

Closest I can think of

1 Like

Nah, ShapeDiver is not it.

Actually the project is about creating buttons in a control panel that are configurable with keyboard inputs. They can assign shortcuts that represent different parameter modifications that can additionally be grouped together and moved arround and then create vector geometry inside a grid that adjusts to the screen size of the monitor you are viewing the definition in.

Think of it like the MacOS dockbar or the Windows taskbar, that produce vector geometry in a grid in the center of the screen. Loosely, a graphical user interface for onscreen keyboard shortcuts.

I’ve added code from the Windows input and gesture repository, so that the “app” can work with mouse, touch or pen input.
It works beautifully inside Rhino. I’m sorry I can’t share it. F*cking bureaucracy.

I was thinking if there is any way to extract the algorithm behind the control panel that creates the buttons and the mechanics for how they work together to produce the end-result and translate it into a workable code that someone could work on top of.

I feel I’m asking for something impossible.

To dumb it down - Is there any way to extract a grasshopper algorithm mechanics [code] to a general code [Pyton,C#] that can be used in a programming process? … to make things easier and preserve the structure and build on top of it.

Well, there are a few ways to do this, all of them are business approaches

  1. buy a license, from McNeel, for Rhino/grasshopper. company wide
  2. Call the good folks at McNeil, and perhaps they will license parts of the program to you
  3. McNeel has shown some hints of allowing access to parts of Rhino in a stand alone environment; in fact if memory serves they have a seminar on just this topic, or perhaps one is upcoming

All of these involve giving McNeel a call.

1 Like

This presentation should provide a good overview of these recent developments:


Interesting. “I’m not the only one!”

In this period i, too, was thinking about it.
Years ago from being a simple CAD rookie I’ve entered the world of visual programming language thanks to grasshopper. Then thanks to grasshopper, step by step in the freetime, I started to do some c# …
Now I’m starting to guess if I could and/or should do everything separately.
(making my libraries, methods, etc… lately I’m using rhino just as a 3d display for c# scripts… I’s fun but strange at the same time…)

Anyway in this I just see how great are rhino+grasshopper and the community around it… otherwise I would be still be the usual click-click CAD designer…

Sorry for the OT.

1 Like

I knew that I was reading about this, which made me open this thread!!!

I’ll see where this project goes since my job is done, but my client should be happy to hear this.
I’ll do the research nonetheless.
This technology seems promising for future use for all of us grass-lovers… I’ll say it – game-changing.

Potentially, building an Electron app with Rhino? Maybe?

Something else — Maybeeeee, building an app system for the client/organization after the building is done, with a complete organizational BIM structure for maintenance and overview of the building’s systems.

@brian am I even in the right ‘ball-park’? Would this be theoretically possible?
For M to XXL sized architectural projects, this would be exactly the solution to a problem we are having today.

I see. Now I get what you are looking for.

1 Like

Human UI is WPF/C#. If you use the Visual Studio Designer you can already do a lot. Don‘t dive into MVVM Pattern (WPF specific) since this a overkill for smaller projects. If you say its about drawing 2D Stuff, you can also reimplement the wheel. Building or using a 3rd party vector library isn‘t that complicated. The level of complication is up to the geometry you are using. Using Nurbs (even 2d) is very difficult, but if the drawing is limited to polylines, circles and other simplistic 2d, then its not.Maybe import/export is.

Of course software development is another deal. But you should ask your company why they are doing so. Depending on what it is, buying a couple of Rhino floating licenses to run your software is much cheaper then developing a full software from scratch. It really depends.

Edit: I currently use Qt with PySide2 (Python) to visualise a calibration process in 2d. I draw the 2d stuff as polylines in Rhino and convert them into QPolygons. Qt used with Python is extremly simple and powerful.


Thank you for your input @TomTom

I’ve elaborated everything to the Studio and they will take it from there and see what’s possible. I doubt they will get anywhere, but my job is done.

But now I’m very interested in the possibilities.

Thank you. I’ll look into this completely.
I’m interested in finding a way to build UIs through Grasshopper + Human UI, since it’s very systematic and easy to build UI systems with it and make them functional inside Rhino.
Also, it’s the only programing language I’m fully comfortable with + some additional C# code.
If we could somehow “export” part of it and make it useful. It’s graphical, so it would be a very natural way to build with it.

From what I know so far, there might be a possibility to preserve the structure at least and tweak the elements in the dedicated code. Maybe I can find a way to build an add-on to drive that process.

Also, if there could be a possibility to make Rhino run on the backend and have it as part of connected systems, as I was saying before - have the full BIM model as a live documentation inside an app with other elements connected on top of it, showing and controlling building systems as HVAC, sewage and water, electrical, etc. Maybe I’m dreaming.

I’ll be looking into this for sure.