Skip to main content
Solved

single ray tracing error code

  • August 12, 2022
  • 1 reply
  • 208 views

redbottle

HI,

Does anyone know if the following : 

singleTrace = ZOS.Z_Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.RayTrace);

singleTrace.GetResults().IsValid

can be used as the error code for the single ray tracing? just like the error code returned in the batch ray tracing?

Thanks!!

Best answer by MichaelH

The GetResults().IsValid is a generic property for all results stating whether the analysis was able to run to completion; it does not consider any of the information inside the results themselves.  So, this does not tell you if there is a ray tracing error or vignetting no a specific surface.  

The 2 options to determine the error code for a single ray trace will be:

  • Use the SingleRayNormUnpol() method under the IBatchRayTrace interface (tool = TheSystem.Tools.OpenBatchRayTrace(); tool.SingleRayNormUnpol();)
  • Save the results from the AnalysisIDM.RayTrace and manually parse the text

The first option has 8 inputs and 13 outputs; two of the direct outputs are errorCode (which tells you which surface the ray trace engine mathematically could not trace past) and vignetteCode (which tells you which surface the ray is vignetted at).  From an API standpoint, the first option is better.

View original
Did this topic help you find an answer to your question?

1 reply

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 358 replies
  • Answer
  • August 15, 2022

The GetResults().IsValid is a generic property for all results stating whether the analysis was able to run to completion; it does not consider any of the information inside the results themselves.  So, this does not tell you if there is a ray tracing error or vignetting no a specific surface.  

The 2 options to determine the error code for a single ray trace will be:

  • Use the SingleRayNormUnpol() method under the IBatchRayTrace interface (tool = TheSystem.Tools.OpenBatchRayTrace(); tool.SingleRayNormUnpol();)
  • Save the results from the AnalysisIDM.RayTrace and manually parse the text

The first option has 8 inputs and 13 outputs; two of the direct outputs are errorCode (which tells you which surface the ray trace engine mathematically could not trace past) and vignetteCode (which tells you which surface the ray is vignetted at).  From an API standpoint, the first option is better.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings