Skip to main content
Question

how to get Tilts from sequential file via ZOS API (and Python) ?

  • November 13, 2025
  • 1 reply
  • 18 views

Dear Community -

I try to retrieve tilt infromation from (in coodinate break surfaces) using the ZOP API and Python.

(Ansys Opticstudio 2024R2, Python 3.8 etc.)

Using the boilerplate files, getting thicknesses etc. works well.

 

    thissurf=TheLDE.GetSurfaceAt(i)
    print('\n',i)
    print('Type: ',thissurf.Type)
    print(thissurf.Material)
    print(thissurf.Radius)
    print(thissurf.Thickness)
    print(thissurf.TiltDecenterData.BeforeSurfaceTiltX)
    print(thissurf.TiltDecenterData.AfterSurfaceTiltX)
 

The attempt to get tilt and decenter data gives 0.0 in the coordinate brake surfaces, where tilts
where deliberately set.

Any idea what I might have misunderstood?

 Best regards, Stefan

1 reply

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 411 replies
  • November 14, 2025

Hi Stefan,

The thissurf.TiltDecenterDataBeforeSurfaceTiltX refers to the following surface property from the LDE:

This is not the Tilt About X or Tilt About Y that you would use with a Coordinate Break in the cells of the LDE.  Rather, you should use the following (pseudo) syntax:

print(thissurface.SurfaceData.__implementation__.TiltAbout_X)

(note, the __implementation__ is only required for Python but should be removed for other languages)