Solved

How to set RayInfo.Vignetted in ZOS-API_Python

  • 19 April 2021
  • 1 reply
  • 153 views

Hello,


I would like to raytrace in SQ mode and check vignetted surface number .


In ZPL, RAYTRACE Hx,Hy,Px,Py ; RAYV() ;


In ZOS-API-Python, I would like to perform the command content above.


But I don't know how to use  RayInfo.Vignetted in ZOS-API_Python.(Error Code:instance property must be accessed through a class instance)


Do you know how to solve this problem?


Thank you


 


Hideki Nishioka

icon

Best answer by David.Nguyen 23 April 2021, 15:09

View original

1 reply

Userlevel 7
Badge +2

Hi Hideki,


This is because RayTrace has fully-implemented settings, but not fully-implemented results (have a look at this post). Therefore, it doesn't have RayData, and that is why you get this error.


Usually, when this is the case, you can use the GetTextFile method of the IAR_ result interface to write the results to a text file. This corresponds to the text tab often found in the analysis windows, which doesn't exist for the Single Ray Trace. Have a look at this knowledgebase article for more information.


Then, you'll need to parse this text file, which contains a column Comment. This column will have the word Vignetted written at the corresponding surface.


Alternatively, you could use the BatchRayTrace tool, which is used to launch multiple ray traces, but works fine with a single ray as well. The advantage is that is has a slightly more user-friendly results.


I hope this helps.


Take care,


David

Reply