RhinoCommon VectorAngle

In Rhino 8, using Rhino.Geometry, cannot compute angle between two vectors.


“TypeError: Rhino.Geometry.Vector3d value cannot be converted to Rhino.Geometry.Vector3d in method Double VectorAngle(Rhino.Geometry.Vector3d, Rhino.Geometry.Vector3d)”

Works fine here:

Hi Nathan,

Confirming that your code above works, but when I plug in values to the input, it no longer works.
I type-hinted to Vector3ds for both v1 and v2.

Seems to work here…

I did not add any type hints to the inputs, still worked, adding type hints to Vector3D also worked.

Hi @Dan_Ki,

Can you post a simple GH file that allows us to reproduce the error you’re seeing?

Thanks,

– Dale

Hi Dale,

I tried creating a gh file for you and it seems to work.
Where it does not work is within Rhino.Inside Revit, which is where I am doing my work.

I am using Revit 2023, Rhino 8 (.NET Framework).
Let me know if you need anything else and thanks in advance for your help.

-Dan

@Japhy - is this something you can look into?

We still need to see a .GH file that isn’t working…

Thanks,

– Dale

Dan, Please help us help you by posting files and systeminfo when reporting an issue/questions. Thanks

https://discourse.mcneel.com/t/please-read-this-if-you-are-logging-a-bug-or-issue/173971/3

Everything is looking OK here with the info provided.

1 Like

Hi Japhy,

See below for the requested information.

Rhino 8 SR12 2024-10-8 (Rhino 8, 8.12.24282.07001, Git hash:master @ 2f42167325d83e0da0f3fe08e796c2b26e602bc5)
License type: Commercial, build 2024-10-08
License details: LAN Zoo Network Node

Windows 10 (10.0.19045 SR0.0) or greater (Physical RAM: 127GB)
.NET Framework 4.8.4762.0

Computer platform: DESKTOP (Hosting Remote Desktop session)

Standard graphics configuration.
  Primary display: Microsoft Remote Display Adapter (Microsoft) Memory: 0MB, Driver date: 6-21-2006 (M-D-Y).
    > Remote Desktop display device with 16 connection(s)
        - Windows Main Display using connection #0
        - Secondary monitor using connection #1
        - Secondary monitor using connection #2
  Primary OpenGL: NVIDIA Quadro RTX 6000 (NVidia) Memory: 24GB, Driver date: 3-22-2023 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 528.86
    > Accelerated graphics device with 0 adapter port(s)
        - There are no monitors attached to this device!

OpenGL Settings
  Safe mode: Off
  Use accelerated hardware modes: On
  Redraw scene when viewports are exposed: On
  Graphics level being used: OpenGL 4.6 (primary GPU's maximum)
  
  Anti-alias mode: 4x
  Mip Map Filtering: Linear
  Anisotropic Filtering Mode: High
  
  Vendor Name: NVIDIA Corporation
  Render version: 4.6
  Shading Language: 4.60 NVIDIA
  Driver Date: 3-22-2023
  Driver Version: 31.0.15.2886
  Maximum Texture size: 32768 x 32768
  Z-Buffer depth: 24 bits
  Maximum Viewport size: 32768 x 32768
  Total Video Memory: 24 GB

Rhino plugins that do not ship with Rhino
  C:\Users\dki\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Corgi\0.6.3.0\Corgi.rhp	"Corgi"	0.6.3.0
  C:\Program Files\Rhino 7\Plug-ins\MeliarComR7.dll	"MeliarComR"	7.0.7973.14135
  C:\Users\dki\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\ggKaramba\24.8.7.8\ggKaramba.rhp	"ggKarambaIFC"	24.8.7.8
  C:\Users\dki\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Bullant\24.10.6.8\bullant.rhp	"bullant"	24.10.6.8
  C:\Users\dki\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\ggRhinoSAP\24.10.16.81\ggRhinoSAP.rhp	"ggRhinoSAP"	24.10.16.81
  C:\Users\dki\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\ggRhinoIFC\24.10.18.8\ggRhinoIFC.rhp	"ggRhinoIFC"	24.10.18.8
  C:\Users\dki\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Karamba3D\3.1.40918\Karamba3D_LicensePlugin_Rhino7.rhp	"Karamba3DLicense"	

Rhino plugins that ship with Rhino
  C:\Program Files\Rhino 8\Plug-ins\Commands.rhp	"Commands"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\rdk.rhp	"Renderer Development Kit"	
  C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp	"Rhino Render"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp	"RDK_EtoUI"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp	"Snapshots"	
  C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp	"MeshCommands"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\IronPython\RhinoDLR_Python.rhp	"IronPython"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp	"RhinoCycles"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\Grasshopper\GrasshopperPlugin.rhp	"Grasshopper"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp	"Toolbars"	8.12.24282.7001
  C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp	"3Dconnexion 3D Mouse"	
  C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp	"Displacement"	
  C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp	"SectionTools"

RH8_vectorangle_bug.ghx (39.1 KB)

Hi Japhy,

I just found something that may be the issue.
I opened Rhino from RiR and am seeing the below:

I hadn’t noticed it before because I generally just open a viewport when working in RiR.
The strange thing is that everything still seemingly works. (I suppose, with the exception of the problem associated with this post…)

Thanks, opening your file we now know its not an issue with the script or the Default Rhino / Rhino.Inside.Revit environment.

Troubleshooting will involve trying on other machines (non-remote desktop) and removing/updating 3rd party plugins.

Hi @Japhy,

I upgraded Rhino.Inside Revit to the latest release and uninstalled all Rhino and Gh plugins and I’m still not getting it to work.

I’ve asked a couple of my co-workers to try and it also fails for them (with the same error message).

By the way, it seems to work in IronPython. Just not in Python 3… Very frustrating.

Is there any way I can get help with this?
Is there a way to locate this file?

File "rhinocode:///grasshopper/1/90a19bf0-eef2-49a4-83be-5622dca37a9f/745816e7-b8d0-4011-b5d3-e4293d35996b", line 3, in <module>

This appears to be a plugin / addin conflict. When in running in Revit the first Addin wins if there is a shared resource, an older/newer version of a resource would then have issues with other addings referencing it.

Removing 3rd party plugins/addins is the troubleshooting method.

Thank you!

FWIW, the issue for me was the GeometryGym IFC Tools.
@geometrygym

image

1 Like

Thanks for reporting, I can replicate this. I’ll reach out to @dale (or others) and see what might be done to avoid this.

@jonm - any updates on this? Thanks!

Hi Dan,

I sent some emails to staff at McNeel and it was discussed but no resolution identified (unless I missed it). My plugin was developed well before Rhino inside, and had a dependency on rhinocommon (now the rhino3dm dlll from nuget). It is not practical for me to refactor this out, there is a lot of common code used to identify IFC geometry (including correcting for tolerance etc). My plugin loads at revit startup, and users might not start rhino so I can’t see anyway of having different builds when revit is running rhino or not.

I can only guess that Python 3 somehow also has a dependency on Rhino3dm (or something that it loads) and that it is a different version causing a dll version conflict. That really needs someone from McNeel to confirm. I am willing to rebuild the gg revit plugin each time rhino is revised or similar, but I need access to the same dll. If @stevebaer or someone can help, I’ll look at it.

Cheers,

Jon