TBC Macros and Extensions

 View Only

why doesn't clr.AddReference find DLL's in the macro folder?

  • 1.  why doesn't clr.AddReference find DLL's in the macro folder?

    Posted 04-20-2022 19:23
    Hi,
    I'd like to use some functions from the mathdotnet library.
    https://numerics.mathdotnet.com/
    It's a single DLL file ("MathNet.Numerics.dll") that I'd like to distribute with the macro .py file.

    Since the standard clr.AddReference didn't work it took me a while to find a workaround
    clr.AddReferenceToFileAndPath (os.path.abspath(os.path.join(os.path.dirname(__file__), "MathNet.Numerics.dll")))
    from MathNet.Numerics import LinearAlgebra as la


    ------------------------------
    Ronny Schneider
    ------------------------------