Missing deprecated information in Rhino_DotNet

I have a plug-in that exists since Rhino 4 written in .NET. It uses both Rhino_DotNet and RhinoCommon but now that Rhino 6 is there it seems I have to get rid of the old code and move to the new RhinoCommon API. I noticed there are a lot of changes and whole classes have been remade. The problem for me is that sometimes I can’t figure out on my own how to refactor the code to use the new API.

Is there a more detailed documentation on the deprecated code from Rhino_DotNet and what to use from RhinoCommon instead?

If you can send me your plugin, I can take a look to see if there is anything we can do to help figure out what needs to be changed. We don’t have a document yet. I need to walk through the process to try and figure out what needs to be written down.

I cannot distribute that plugin so easily. I can tell you of some things I noticed in the process of adapting the code.

So for example I cannot find the method

public void Regen()

from class RMA.Rhino.MRhinoDoc on the new Rhino.RhinoDoc class. Is it that it’s not needed anymore and a Redraw() can be called instead?

Another one: On RMA.OpenNURBS.OnBrep there was a Create() method taking a NurbsSurface/Surface as a parameter. I replaced this by the static method Rhino.Geometry.Brep.CreateFromSurface(). Is that correct?

Regen should still be available in Rhino_DotNet
image
If you are looking for the equivalent RhinoCommon function, you would call RhinoDoc.Views.Redraw()

The RMA.OpenNURBS.OnBrep.Create function also still exists. You are correct that the CreateFromSurface function would be the equivalent.

I was asking for your plug-in because there may be things I can do to just make it continue to load in V6 without any changes on your part. I can’t make that decision without looking at the assembly though.

But I shouldn’t use the Rhino_DotNet library anymore, should I? I guess I just have to figure it out and come back if something is unclear.

Regarding these API changes, it’s one thing to deprecate single methods but another to deprecate a whole class. This just leads to confusion because it’s unclear where to find the equivalent. Maybe in the future you could try to deprecate them one by one or prepare a list of the deprecated items. That would be very helpful!

That is the eventual goal. We deprecated Rhino_DotNet in Rhino5, but didn’t break anything. Now with Rhino 6, there are some SDK breaks that occurred in Rhino_DotNet. I may be able to patch up some of these breaks if I knew what wasn’t compiling/working with your plug-in.

RhinoCommon is where all of the enhancements go and is a much more mature SDK in general.

I can see where this can cause confusion and I’m sorry about that.


All that said, Rhino_DotNet will remain in Rhino 6 and you can use it in conjunction with RhinoCommon for a gradual shift over to being RhinoCommon based instead of completely cutting the cord all at once.

Thank you so far for your help!

In the RhinoCommon v5 there are a few things missing to replace the Rhino_DotNet code. I want to build the plugin for both 5 and 6 which is why I try to stay compatible to both RhinoCommon versions. For example the Rhino.Geometry.Brep class and classes used inside are missing some details you added in RhinoCommon v6:

  • No Surfaces property on Brep
  • No Add method on BrepFaceList
  • No Add method on BrepLoopList

That’s fine for me. The one thing I noticed that is not available in RhinoCommon are the old DockBars (MRhinoUiDockBar, MRhinoDockBarManager). I found a case about this (How can I dock panels on TOP?) so it seems this might be added in the future. If this would be added to RhinoCommon v6 I could get rid of Rhino_DotNet as soon as I drop Rhino 5 support.

Use RhinoWindows.Controls.DockBar. This feature is in the RhinoWindows assembly. and not RhinoCommon because it is Windows specific.

Let me know if you need an example.

– Dale

Thank you, Dale. I won’t need an example. You can close this case.