The issue may be related to an incorrect OpticStudio executable path found within the code.When using the API to perform user analysis or other modes, the first step is to locate the installation folder of OpticStudio. If multiple versions of OpticStudio are installed, the determination condition may not be met. This can result in isInitialized returning false and displaying an error message. Reinstalling OpticStudio may often resolve this issue. Since I have not encountered any problems with version 2023 R2, I suggest trying the following two methods:
First, close all OpticStudio files, including those in use by third-party programs running in the background, such as Matlab, Python, or Visual Studio.Then, locate the file named "version.log" under the folder C:\Users\...\Documents\Zemax\License and delete it.Open Ansys Zemax OpticStudio, and it will automatically update the contents under the Zemax Data folder(including the ZOSAPI_NetHelper.dll). Ensure that the process is not interrupted and avoid any files within the Zemax Data folder that are currently in use. Then open OpticStudio, and try the user extension. This is what I got after trying method 1.
Close all OpticStudio files, including those in use by third-party programs running in the background, such as Matlab, Python, or Visual Studio.Reinstall the latest version of OpticsStudio.
There are a few more reasons why this could fail (such as “Prefer 32-bit” when the Platform Target is Any CPU, using a VM with a UNC path for the User Extension, or uninstalling an old version of ZOS after installing the current version). All these issues stem from a failure to locate the OpticStudio.exe (and more importantly, the ZOSAPI.dll & ZOSAPI_Interfaces.dll in the same folder) and this is directly due to the ZOSAPI_NetHelper.dll.
I opened a case (#59566) in March of 2023 with a patch to solve this issue. It was closed as “not needed” but if you have to create a post about this issue, I think you should look at this case and potentially reopen/implement the solution.
Hi Michael, many thanks for letting me know this! I am discussing internally to see what we can do. Really appreciate your help!
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.