Skip to main content
Solved

Error using ZOS-API in Python


PhWest

My codes (that were working with the 2024 version) do not work anymore with the 2025 release.
This is the error I get:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'ZemaxEngine.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A).

Best answer by jwbeenakker

Hi PhWest,

Have you considered using ZOSPy? We recently released a new version, which works very well with the 2025 release (see https://zospy.readthedocs.io/en/latest/compatibility.html )

View original
Did this topic help you find an answer to your question?

2 replies

jwbeenakker
  • Visible
  • 28 replies
  • Answer
  • April 2, 2025

Hi PhWest,

Have you considered using ZOSPy? We recently released a new version, which works very well with the 2025 release (see https://zospy.readthedocs.io/en/latest/compatibility.html )


MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 348 replies
  • April 2, 2025

Hi Philip,

You can also have multiple versions of OpticStudio installed on your computer so you can install OpticStudio 2024R2 to use your code and OpticStudio 2025R1 with the latest features for your other work.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings