ObjRef(RhinoDoc doc, Guid id)

Hi,

On windows i can’t get ObjRef(RhinoDoc doc, Guid id) to work. Works fine on MacOs but in visual Studio i get this:


Cant’t do ObjRef(Guid id) because it’s depricated but for some reasons it dosn’t know the ObjRef(RhinoDoc doc, Guid id) version.

Thanks for any help!

What is the message for the red squiggles?

Cannot convert from ‘Rhino.RhinoDoc’ to ‘System.Guid’ and cannot convert from ‘System.Guid’ to ‘Rhino.Geometry.ComponentIndex’
Seems like it dosn’t know the ObjRef(RhinoDoc doc, Guid id) Version…

Perhaps you have RhinoCommon version mismatches?

@seppeldue are you certain that curveGuid is a Guid? and not a ComponentIndex?

These are the constructors of ObjRef in Rhino 8:

I suspect something like it, as it works on MacOs… How do I check and match?
Thanks :pray:t2:

How are you referencing RhinoCommon in your project?

@nathanletwory

Are you refering to this?

Also:
Visual Studio 2022
Rhino.VisualStudio.Windows.2022-8.10.0.vsix

You are referencing RhinoCommon 7.0 . You need at least RhinoCommon 7.6 as you can see from the documentation for the constructor with that signature: ObjRef Constructor (RhinoDoc, Guid)

Okay, i’m having trouble getting the version right.
i Updated to the latest but than it only worked for Rhino8 (net7.0?) but not for Rhino7.

Than i tried to downgrade but i can’t get matching versions

Now net7 is on 7.6 but net48 is still on 7.0 and i don’t see how do update this?

Looks like you’re using the Grasshopper package through which RhinoCommon is used. You need to update the Grasshopper package to ensure the RhinoCommon transitive package also gets updated.

So what Version does the Grasshopper package need to be? It is on 7.6 and the RhinoCommon too. But it only goes to net7. net48 is still on 7.0 and i don’t see an update option for net48

I would just change this directly in your .csproj file. Look for PackageReference tags for RhinoCommon and Grasshopper then change the version info to the version you need.

Is there a reason to stick to 7.6 and not the latest 7.37 or the version prior to that 7.36?

1 Like

I have no reason not to run the latest. This is just how it was setup by Visual studio and the ‘Rhino.VisualStudio.Windows.2022-8.10.0.vsix’ plugin. All i need is it running in Rhino 7 and 8. But when i updated to 8.x it only worked for net7 and thus Rhino8

So maybe i drop the net7.0 all together (in the .csproj file), or is this a bad idea?
and should i then go to 7.37? is that newer than 7.6?

37 is higher than 6 - that is in our release schedule 31 releases - at least 31 months worth of fixes.

If you need to release your work for Rhino 7 then I would suggest to multitarget, but still reference RhinoCommon and Grasshopper 7.36 for both targets.

1 Like

Thank you @nathanletwory !
Doing it via the .csproj file is so much easier than the solution explorer!

1 Like