WPF/WinForms Front-end App based on Rhino/GH?

… or whatever way to put it.

Rhino Viewport peep-through?

I’m making a specialized application which will be heavily based on Rhino and GrassHopper components using RhinoCommon, and I plan to use a separate User Interface where some Rhino Viewports peeps through the windows Forms without exposing its own UI.

Is that possible with Rhino? (only displaying the Rhino Viewports from within a .NET application, that is)

Type of Win App?

If the Viewport thing is possible, I would also need some advice regarding the type of Win App to start from. WinForms or WPF? (I’m new to .NET)

Since I am currently learning both Rhino, Gh and .NET in one go I would humbly and readily listen to advice from experienced .NET. developers. (I’m an ol’ Delphi guy from the pre historic but glamourous days of Delphi 7 & 2007)

VS2015 Project

I will code the main form (and possibly the main app) using either VB.NET or Remobject’s Elements Oxygene using VS2015 Community for now (I’m currently evaluating both VB.NET and Oxygene).

Specific Problem Domain

Not that I’m ashamed of “putting Rhino on display”, but the end users of the app will have no idea about CAD tools, and will need only to see the (interactive) graphical results of their “parametric” user input of some predefined specific geometries within only a specific problem domain. No drawing or even editing will be performed by the users.

Most of the logic will be based on and executed by GrassHopper (Rhino5).

Platforms

Although I can live with ending up supporting Windows only, it is always a good idea to consider platform independent solutions. UI technology usually is a showstopper in this regard. Should I forget about multi-platform altogether, given the basic approach I’m taking?

All advice is very much welcome.

// Rolf

Fig. 1. OK, you get the idea :

Hi @RIL,

A standalone .NET application, no. We have, however, prototypes a control for Eto that you could use from within a plug-in.

– Dale

OK, but if the application is GH based, it can use the entire .NET world (?) and then the question again - can a GH application pick only the Viewport(s) and insert it/them into a new form? It doesn’t matter if I would have to “fake” the visual impression of the viewport being integrated into the form, technically it doesn’t matter, if it only looks like it is. “Viewport on top of another form” would be good enough.

I notice that viewports can be manually detached from Rhino as a “free-floating” window, so if this could be done with code, and kind of fake integration with (or on top of) another form, the form in the “background” then… see the picture again.

// Rolf

Hi @RIL,

We have a very basic prototype working that you can experiment with and let us know where it would need to be changes. Here is a sample script that uses the Rhino.UI.Controls.ViewportControl control.

https://github.com/mcneel/rhino-developer-samples/blob/wip/rhinopython/SampleEtoViewports.py

– Dale

2 Likes

Assuming that I can find some package of Eto for Rhino on NuGet.org but which one?

https://www.nuget.org/packages?q=Eto

I tried searching for more info on how Eto integrates with Rhino but I couldn’t find any. Google must be broken… :slight_smile:

// Rolf

Eto.dll is included in RhinoWIP.

I’m developing for Rhino5.

This one? GitHub - picoe/Eto: Cross platform GUI framework for desktop and mobile applications in .NET

// Rolf

Just so you know, the RhinoViewport control that Dale mentioned is only available in the WIP

That’s a no go for me for now. Thank you for letting me know.

// Rolf