I've tried running the example file PythonStandalone_02_NSC_ray_trace.py and realized that it fails when trying to read out ObjectData:
numXPixels = obj.ObjectData.NumberXPixels;
Result:
AttributeError: 'IObject' object has no attribute 'NumberXPixels'.
The code runs flawlessly, except when reading ObjectData. I have spent a full day trying to debug this error without success.
I have also tried the methods outlined in
PPG example not working | Zemax Community
and
ZOS-API Python: How to deal with AttributeError and apply the correct enumeration | Zemax Community
without success.
Does anyone know how to continue debugging?
Note: using Zemax OpticStudio 22.2.1