Eto support in all Rhinos

Continuing the discussion from User data entry in scripts:

Eto appears to be part of Mac-Rhino and Win-Rhino WIP. It would be great if Eto will also be supported from Win Rhino V5 in future service releases. Then we could develop complex user interfaces which work cross-platform and cross-version without any hassle for the users.

Do you think this is possible / will happen? @curtisw @stevebaer

It is possible, but Iā€™m not sure how likely this is to happen. We are very late in the service release cycle for Rhino 5 and just ā€˜bundlingā€™ Eto with V5 does not completely solve this issue. There is a small amount of Eto initialization that has to occur at start-up and I really donā€™t want to introduce more dependencies to V5 at this point in time.

The other way to solve this is to bundle Eto with your V5 plug-in or script and call the initialization code yourself.

I hope that Eto dialogs become popular and common soon! To make this come true all scripts should run cross-platform on Mac and Windows. Iā€™d like to avoid that each Windows Python script which includes a dialog comes with a separate Eto bundle and/or needs a different script version.

Maybe this could be solved by a custom installation of Eto? So we can send the users to a Wiki-page with all the instructions to install it. Just some early thoughtsā€¦ V5 on Windows will be the main Rhino for a loong timeā€¦

2 Likes

I would be interested in that custom installation of Eto on Rhino 5 too.

Interesting idea, though Iā€™m not sure if adding confusion by forcing users to get a separate download would makes things better or worse.

This could be done with a basic C# plug-in that includes the Eto Dlls and initializes Eto when loaded.

Sure it would be better if Eto were supported ā€œout of the boxā€ :smiley:

Iā€™m experimenting with an interface for custom user-data and Eto seems to be the perfect tool with itā€™s table like structures. Iā€™m far from anything useful (for the lack examples), but once that works Iā€™m sure everyone wants to have it - and Iā€™m also sure that everyone wants to customize it. Also great for Excel / csv filesā€¦

I see a lot of new developments for Rhino, but only a few ā€œinsidersā€ have the chance to really get into these. The developers do not have the time to document their work or write some examples which may help the ā€œsemi-professionalsā€ to use all that beautiful stuff. Community on idleā€¦ if everything is put into plug-ins.

I thought you were an open source fan? :wink:

Believe me, weā€™re working on improving that situation :wink:

1 Like

Steve,

Is there anyway to get an example of this? I have also been maintaining a custom user data plugin that uses the rhino panel and docking, however I cannot seem to initialize an Eto form as it does not follow win32 interfaces, it fails when I attempt to register it at plugin initialization.

Rhino.UI.Panels.RegisterPanel(this, panelType, ā€œSampleā€, System.Drawing.SystemIcons.Question);

Something like Dales Sample User Panel or a hint at that with Eto would be very helpful.
https://github.com/dalefugier/SampleCsPanel

Iā€™m sorry but we donā€™t have a sample at the moment (we actually havenā€™t even attempted to create an Eto panel in V5, but we do know this would work). @curtisw may have some hints.

I donā€™t know that we need a full example but something to get us going would be greatly appreciated.We are utilizing DataGridView along with custom column drawing. If we want to port to OSx this will all need to be rewritten, having the same code working on both Windows(v5) and OSx(v5) would allow us to do this.

We have had the thought of simply opening a form and not attempting to dock with Rhino Tabs but this is plan B.

The current issue is to get the panel started in Rhino. Please see the attached image. Some help would be great.

Christian

Here is an example that demonstrates how to display an Eto form in a docking panel.

Word of warning: all this will change in Rhino 6, as it includes the Eto binaries and weā€™ve done some work to make this easier.

4 Likes

Thanks Dale

Wow. Thanks Dale. This is great. Letā€™s see if we get it to work.

So we got this panel to work. Thanks again. We are wondering how to get the menubar to add to the panel. The example we found:

doesnā€™t work. Seems like this only works for Modal and Modeless Forms.

Any help would be great.

Thanks in advance
Christian

This might be a silly question but is Eto accessible from python script (canā€™t find Eto namespace in python editor) or only c#? Iā€™m asking about Windows Serengeti

Yes, it is accessible from python script and we do plan on making this easier in general to work with from python. I believe @curtisw was looking into this last week.

Oh OK I found itā€¦

@stevebaer, is there any news about using python + ETO in V5 ? I can use ETO in V6 but when i try below in V5, it seems to import the whole namespace properly:

import clr, sys

sys.path.append(r"C:\Program Files\Rhino WIP\System")
clr.AddReference("Eto.dll")
from Eto.Forms import *
from Eto.Drawing import *

ā€¦but once i try to create a dialog or a form using:

form = Dialog()

I get this error:

Message: Platform instance is null. Have you created your application?

_
c.

I love it; super hacky :slight_smile:

@curtisw is going to have some better techniques than me, but you might want to try adding the following to your script

platform = Eto.Wpf.Platform()
app = Eto.Forms.Application(platform)
app.Attach()

Youā€™ll probably need to do something like use sticky to hold on to the fact that you initialized the app.

1 Like