Installing a native library so it is visible from ironpython

Thanks for all the replies, you all have been a big help.

Now that i’m nearing completion of my native library, I am looking to make a .rhi installer file to install it. The end goal is to be able to import the dll in ironpython similar to how rhino common is, however I am unsure of how to make it visible to ironpython without giving clr.addreference a direct path to the dll.

Is there any way I can install the DLL so that the clr always adds it as a reference?

Hi @db368,

two possible ways, if it’s for your system only, have you tried to add a new searchpath to the dll directory under:

_EditPythonScript > Tools > Options > Module Search Paths > Add to search path

alternatively, you can install ModuleName.dll with your compiled plugin (rhi). Then use

clr.AddReference(ModuleName)

and it should be usable after importing the namespace. I have a dll which is called like this and the path to it has not been defined as search path like above, so it is not listed in sys.path.

_
c.

1 Like