Skip to main content

Hello,
i am using Zemax Optics Studio 23.1 and trying to run the python example files included in the “Zemax\ZOS-API Sample Code\Python” directory.
While others seem to work, when trying to run “PythonStandalone_23_ray_fan_native_manual_comparison.py” i get an error.
----
Traceback (most recent call last):

  File "c:\ex\PythonStandalone_23_ray_fan_native_manual_comparison.py", line 262, in <module>

    ray_settings.Field.UseAllFields()

    ^^^^^^^^^^^^^^^^^^

AttributeError: 'IAS_' object has no attribute 'Field'

Exception ignored in: <function PythonStandaloneApplication.__del__ at 0x000001D4F7E9F880>

Traceback (most recent call last):

  File "c:\ex\PythonStandalone_23_ray_fan_native_manual_comparison.py", line 72, in __del__

TypeError: 'MethodObject' object is not callable

----
I run the original file without any changes. 
Could somebody please possibly advise if eventually the API did evolve and this particular example file is no more compatible?

Best regards
Dimiter
 

Hi @dgeorgiev,

 

I believe it relates to this issue:

Basically, if you replace this line of code:

ray_settings = ray.GetSettings()

by this one:

ray_settings = ray.GetSettings().__implementation__

It should correct this error at least.

@Allie or @Chris Normanshire do you know if there’s a plan to update the eaxamples so they comply with more recent versions of Pythonnet?

I hope this helps and take care,

 

David


Thank you David,
I greatly appreciate your quick and effective help!
Best regards
Dimiter

 


Hey @David.Nguyen - Yup we are planning to update the files! I don’t have a timeline for you yet, but it’s definitely on the radar.


Reply