Porting RhinoCommon Windows plugin to OSX

Hi

I have installed all the OSX RhinoCommon stuff as per the McNeel docs onto a Catalina Mac. I open my Windows plugin code on Catalina Visual Studio, and there are a bunch of issues. I have decided that the approach I have taken on Windows is probably not going to work on OSX, so I am going back to square one.

First question…

My main (dockable) panel in the Windows version is a UserContol. There does not seem to be a UserControl object on Rhino for Mac. What should I use instead please (keeping in mind I ultimately want the same code to run on Windows and OSX).

Thanks

Paul

You should use the cross-platform Eto UI library, which is an abstraction over the platform-specific UI libraries (WinForms/WPF on Windows and Cocoa on OSX). It is delivered with Rhino on both platforms, and many of Rhino’s UI elements are using this as well.

For more information, see https://github.com/picoe/eto and search for Eto on this forum.
Also, there is a sample plug-in with Eto on GitHub.

Thanks. I will take a look at the samples. However I am dubious as to if this is all worth the effort. Visual Studio on Catalina (fresh install) seems incredibly unstable. I am getting a lot of crashes or needing to Force Quit. Are developers able to live with this, or is it just an exercise in frustration?

Paul

I downloaded the rhino-developer-samples-6 zip from github, and opened in Visual Studio for Mac. As these were intended for Windows, I deleted the windows dll references, and added the NuGet RhinoCommon package. But I get a bunch of errors when compiling, mainly related to the Properties/Resouces.Designer.cs file. I would have thought the McNeel provided samples would work on the Mac? Perhaps they could provide Visual Studio for Mac project files. Is there a workflow to migrate from Windows to Mac?

Thanks

Paul

https://developer.rhino3d.com/guides/rhinocommon/what-are-mono-and-xamarin/

" It is important to stress: these are Visual Studio solutions and projects. You can open solutions and projects created in Visual Studio for Mac in Visual Studio for Windows and vice-versa."

I am finding this is not the case. If I have a multi-source project in Windows, each of the source files is listed in the .csproj file as…

<Compile Include="SelectViewForm.designer.cs">
  <DependentUpon>SelectViewForm.cs</DependentUpon>
</Compile>

However in Visual Studio for Mac, multiple “<Compile Include…” lines throw a compilation error indicating there are multiple compile targets.

If you File->New Solution->RhinoCommon Plugin->Provide Sample Code TICKED in Visual Studio for Mac, then the resulting project has multiple .cs files, but the .csproj does not list any of them.

Is there a Visual Studio setting that controls this behavior?

Thanks

Paul

I have no idea why these projects don’t work - maybe @dale or someone else from McNeel can help.

FWIW Raytraced/Cycles project files are the same on both Windows and Mac. I use only Eto-based controls, no designer parts at all.

There some parts where I tweaked the project files manually a bit to allow for using them on both Windows and Mac, for instance here: