Skip to main content

 

 

 

The issue may be related to an incorrect OpticStudio executable path found within the code.
?name=image.png
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:
 

Method1:

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.
?name=image.png
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.
?name=image.png
 This is what I got after trying method 1.
?name=image.png

Method2: 

 
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. 


Hi @yuan.chen,

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!


Hi @yuan.chen,

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.  

Dear Michael,

Your information is helpful! What will be the fix in the case of “uninstalling an old version of ZOS after installing the current version” besides reinstalling OpticStudio?

Regards,

Jiang


Final version:

1. Uninstall ALL OpticStudio software (both Ansys and Legacy).
2. Then go to Documents\Zemax\License and delete the "version.log" file.
3. Then install the newest Ansys version: Ansys OpticStudio Downloads – Zemax
4. When prompted, make sure that the user copies the files into their Zemax directory.

The problem could be in the registry or in the Helper DLL. These steps should solve the issue without a bunch of troubleshootin


Reply