Rhinocommon Templates for V7?

Some progress to report that might help some people but, inevitably, a set-back.

In your VS Solutions panel, right click on the SECOND row called “ProjectName”. Refer to the attached image. Go to the bottom of the menu and click on Options. You should get a screen similar to the one shown in the image. At the top of that panel you’ll see an option called Plug-in Type. It doesn’t seem to matter if you choose Grasshopper Component or Autodetect. The important thing is that VS detects a Version 7 component. If it doesn’t, as mine originally didn’t, you’ll need to correct your project files with some kind of text editor.

Go to your ProjectName.csproj file, then make sure you have code that states something like:

That is to say, the version number must not be something like 6.x, as would be generated for Rhino 6.

So, that got the de-bugger to recognise Breakpoints. And immediately I ran into a problem initiating Surfaces or NurbSurfaces. It didn’t matter where I tried to do the declarations in my code. I got the same error. Which I don’t really need to get into, but here’s the fix. I’m sure it will help with other problems. In your Solutions panel in VS go to the ProjectName subdirectory and make sure your Dependencies include Grasshopper and RhinoCommon in the NuGet subdirectories, as shown in the image. Make sure you update these. You can do that with a right click. After about a five hour search, where I found other things that may or may not have been awry, updating the Dependencies finally got things to work.

image

At least for a day or so. Then for no apparent reason the debugger stopped finding Breakpoints.

Which brings us to the next saga. It turned out that something deleted my RhinoCommon.dll file from the location I had set. It could only have been VS or Rhino because I wasn’t working with anything else on my computer at the time. Fortunately, I had another copy elsewhere on my machine. (Which brings up another topic. Why, if I’ve upgraded to Rhino 7, got the most recent updates for everything RhinoCommon, why does my RhinoCommon.dll file have a date of 24 June 2020 on it?!) So I re-installed the RhinoCommon.dll and still VS wasn’t finding the Breakpoints.

Right now the only way I can detect Breakpoints is if I run the component on a Timer. Which I was doing anyways but it makes de-bugging very difficult and has a habit of hanging up. Right now I’m thinking of abandoning Rhino 7 completely.

I’ve probably done all kinds of things wrong in these fixes. I’m not the expert on these things. Nor do I ever want to be. I really, really, really don’t want to be an expert on these things!! But, given the current state of the release, I’ve got no choice.

So, to the very good people at Rhino – and I do think you’ve done wonderful work – please, please PULEEEASE (!) come up with a Rhino 7 Plug-in Wizard soon. For the rest of you, if you’re interested in geometry, architecture, AI or anything else but vagaries of computer threading science, I’d advise to avoid an upgrade to Rhino 7 like the plague!

John O’Keefe

Please post your csproj file. We can take a look and see if anything looks out of place

Hi Steve.

Thanks for getting back so quickly. Here’s a screen copy of the csproj file.

It never fails Steve, as soon as you ask a question you find your own (possible) answer. I started to create a new VS Solution for Rhino 6 and realized that the Solution I’ve been complaining about was probably done with the Rhino 6 radio button clicked on the initial set-up and not the Rhino 7(WIP) button. I’m going to give that one a go now.

I’ll let you know if I have any better luck.

Thanks again Steve.

Steve,

Quick note. Got things working with the initial WIP 7 set-up. Still a few bugs but nothing serious. I’ll try to check in tomorrow when I know more.

Thanks again!

JOK

Steve,

Things aren’t working any more. The (short-lived) initial success was just a mirage. I’ll upload some information for you that might help.

This is what the current csproj file currently looks like.

I tried something that actually gets the Breakpoints to work for a little while when the program and Grasshopper are just starting out. I initialize some variables before I actually get into the component (it’s a recursive Genetic Algorithm). VS finds the Breakpoint, initialises a dozen or so variables then moves to the lines highlighted in green in the following image.

When it exits that, after to two {}’s it throws up the following error.

The program hasn’t started yet, Grasshopper is still initialising. After that, if I click on Run/Continue Debugging in VS, Grasshopper will finish loading but the component is, in effect, dead. Or at least it appears that way. The programme is a copy of a previous one that was running but there might have been some errors introduced in my copy. The component isn’t showing any errors, but no output either.

A few more things to note that may or may not help. When I screen copied the error message above, I included something funny looking on the left. RhinoCommon seems to be loaded twice. I can’t get rid of the one that seems to be in a subdirectory of Grasshopper. As you can see from the csproj file though, RhinoCommon only appears to be loading once.

Also, whenever I exit and re-start VS, it loses the RhinoCommon.dll file. (I’ve got that stored in my Applications folder for the time being.)

Finally, VS, Rhino or both seem to be creating some dll files in my Bin/Debug/net45 directory that I haven’t seen before. Here’s an image showing their names.


Thanks in advance for your help Steve.

John O’Keefe

@curtisw is planning on updating our templates in the near future. Hopefully this will fix the problems you are seeing.

1 Like

Good to hear Steve.

Thanks so much.

I’ve gone back to Rhino 6 for the time being but will look forward to the bright new world of Rhino 7!

Hi @john25,

The issue you’re running into is due to a problem with our Grasshopper Nuget Package, where it causes the RhinoCommon assemblies to go into your output. There’s RH-63423 to fix that up which I will get to asap.

For now, you can add IncludeAssets="compile;build" to your PackageReferences like so, and ensure none of the extra .dll’s are in your output directory:

    <PackageReference Include="RhinoCommon" Version="7.4.21067.13001" IncludeAssets="compile;build" />
    <PackageReference Include="Grasshopper" Version="7.4.21067.13001" IncludeAssets="compile;build" />

Hope this helps!

HI, trying to start a rhino 7 plugin on vs2019, is throwing this error when I try to “create” a brand new project.

I’m working with Rhino 7.7.21151.13001 (latest one). Maybe a compatibility issue?
Managed to make it work with Rhino6 template for VS2017 though, manually redirecting rhinocommon.dll and rhino.exe…

should I avoid trying to use vs2019 + template for Rhino7 plugin ??
thanks

Hey @aitorleceta,

Do you have this? There is a fairly new update available.

– Dale

Hi @dale , yes I installed this version today…

Hmm - seems to work here. @curtisw, any thoughts?

@dale, solved updating VS2019. Thanks

Any chance of getting a Mac version of this?

The download suggests that it’s only a Windows version.

I’m hoping to enter the wonderful new world of Rhino 7 but can’t do that without our trusty RhinoCommon.

Still living in the by-gone days of Rhino 6 :wink:

John O’Keefe.

Hi @john25,

Here you go:

Install instructions can be found here:

– Dale

1 Like

Dale,

Thanks for responding so quickly.

I’ve said it before and I’ll say it again. You guys don’t let the grass grow under you feet do you?!

Got everything installed and it’s run one of my more difficult GA routines.

Rhino 7 here I come!!

John

Hello

I’m having issues updating a plugin project to Rhino v7. The project was originally built with a V6 template on Visual Studio Mac 2019. After updating the extension and de-referencing nuget v6 libraries. I’m getting an unexpect runtime error with the RegisterInputParams method. Previously I was able to provide a default value for plane inputs.

pManager.AddPlaneParameter("Plane", "Pl", "The plane the polygon is on", GH_ParamAccess.item, Plane.WorldXY);

After updating to V7 I’m getting this error while loading the plugin on Grasshopper:

System.MissingMethodException: Method not found: int .GH_InputParamManager.AddPlaneParameter(string,string,string,Grasshopper.Kernel.GH_ParamAccess,Rhino.Geometry.Plane)
  at Grasshopper.Kernel.GH_Component.PostConstructor () [0x00006] in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/Kernel/GH_Component.vb:161
  at Grasshopper.Kernel.GH_Component..ctor (System.String name, System.String nickname, System.String description, System.String category, System.String subCategory) [0x0005b] in /Users/bozo/TeamCity/buildAgent/work/96e64af5b81c6f85/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/Kernel/GH_Component.vb:148
  at RoomSurveyor.RoomSurvey4..ctor () [0x00000] in /Users/filipe/10_VSProjects/RoomSurveyor/RoomSurveyor/RoomSurvey4.cs:43

What’s odd is that it is not happening on other input types e.g. boolean or int…