I am trying to change the Aperture file of a surface aperture using python. All I could do is to change the Aperture type to User Aperture but the Aperture file is not specifyed.
Using Matlab, it is working perfectly using the same code and also, it works that I can change the Aperture file manually in zemax so this means the aperture uda file is at the correct location with the correct content.
I also tried to change the filename string to the full directory of the uda file and it is not working too.
[Mod note: moved to more appropriate forum for ZOS-API related discussions.]
Best answer by David.Nguyen
Hi Baraka,
I had to modify your code a little bit because Surface_3 isn’t defined, but other than that it works fine for me on Python 3.8.13 and Pythonnet 2.52. Could you check and tell us your version of Python and Pythonnet? There have been issues with more recent versions of Pythonnet lately.
The code I used with a default lens file is the following:
I had to modify your code a little bit because Surface_3 isn’t defined, but other than that it works fine for me on Python 3.8.13 and Pythonnet 2.52. Could you check and tell us your version of Python and Pythonnet? There have been issues with more recent versions of Pythonnet lately.
The code I used with a default lens file is the following:
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.