Rhino crashes while import OPCUA bib without any error message

Hey there,

i am trying to automate the process of creating G-Code with the RhinoCAM2023 PlugIn with Rhino7.
First i tried to do this with Rhino8, but there are problems in the communication to the PlugIn. So i try it with Rhino7.
I want to control the automation from a OPC UA server. With Rhino8 it was no problem to install the bib opcua and use it. I installed it with

pip install opcua.

Now i have no idea why this doesn´t work with Rhino7. I installed the bib in the following path:
C:\Program Files\Rhino 7\Plug-ins\IronPython\Lib

I hope anybody has a note which mistake I made…

– Stefan

@Stefan9 What if you place the library under C:\Program Files\Rhino 7\Plug-ins\IronPython\Lib\site-packages path? Does that work?

@eirannejad I have added the search path in the options and copied the library. It takes longer till Rhino crashes (or freeze), but it still does. Could you try importing the library into Rhino8 IronPython? I attatched the used library.
opcua.zip (2.2 MB)

The reason why i have to use Rhino7/Rhino8 with IronPython is that in python3 the import

import mecsoftcamapi

doesn`t work. In IronPython it is no problem. The library is in this path:

C:\Users\<username>\.rhinocode\py27-rh8\Lib\mecsoftcamapi

in Rhino8. If i copy this library to py39-rh8 it doesn`t work. This seems to be logical to me because it is another programming language. Is there a chance to get the mecsoftcamapi library for Rhino8 python3?? This would solve all my problems because the opcua works with python3 without any problems

-Stefan

@Stefan9

I do not see mecsoftcamapi library on Pypi.org (source for all python 3 packages). Where do you get that from?

The opcua and pytz libraries in the zip file you shared can be downloaded from Pypi. you can just specify them in your script and the editor will handle installing them in the right place

#! python3
# requirements: opcua, pytz

import opcua
import pytz

print(opcua)
print(pytz)

Yeah in python3 I was able to use the opcua lib. But not in IronPython which is necessary for mecsoftcamapi. This lib is contained in the RhinoCAM plugin (you have to pay for it).
Thanks for the note with pypi.org.

1 Like

You may eant to check RunPythonScript, choose interpreter to IronPython 2 Rhino8