Solved

zos api: change surface for geometric image analysis

  • 22 September 2023
  • 3 replies
  • 69 views

Hello! Can somebody please help me figure out how to change the surface for geometric image analysis? I’d like it to default to the image surface. 

gia_run = TheSystem.Analyses.New_Analysis_SettingsFirst(
ZOSAPI.Analysis.AnalysisIDM.GeometricImageAnalysis
) # make new analysis, but don't run it
gia_settings = gia_run.GetSettings()

# I was hoping for something like the following (this doesn't work though)
gia_settings.Surface = ZOSAPI.Analysis.Settings.Surface.IAS_Surface.UseImageSurface

Thanks!

Liz

icon

Best answer by David.Nguyen 22 September 2023, 19:40

View original

3 replies

Userlevel 7
Badge +2

You’re almost there, but you have to use something like so:

gia_settings.Surface.SetSurfaceNumber(<your_surface_number>)

The Surface property returns an interface that has several methods:

  • GetSurfaceNumber ()
  • SetSurfaceNumber (int N)
  • UseImageSurface ()
  • UseObjectiveSurface ()

You can find those if you click on IAS_Surface on the left of the Surface property in the Syntax Help.

I hope this helps. Take care,

 

David

got it, thanks for your help. for anybody interested in how I ultimately did this, I’m making zemax analyze the last surface with 

last_surface_number = TheLDE.NumberOfSurfaces - 1
gia_settings = gia_run.GetSettings()
gia_settings.Surface.SetSurfaceNumber(last_surface_number) #analyze GIA on the last surface

best,

Liz 

Userlevel 7
Badge +2

That’s an excellent solution.

Sorry if I wasn’t clear when I listed the methods of IAS_Surface, but you could also try:

gia_settings.Surface.UseImageSurface()

Take care,


David

Reply