Skip to main content

Hey, I’m very naïve to Zemax and ZOS-API. 

I just tried to find the setting and run the code, but I couldn’t see the results from the image simulation.

I used the standalone application and here is my code.

 

    # load local variables
    ZOSAPI = zos.ZOSAPI
    TheApplication = zos.TheApplication
    TheSystem = zos.TheSystem
    
    # Insert Code Here
    file = "C:/2021/Zemax_Image_Simulation/test.zmx"
    cfg = "C:/2021/Zemax_Image_Simulation/test.CFG"
    TheSystem.LoadFile(file, False)
    TheImageSimulation = TheSystem.Analyses.New_ImageSimulation()
    analysisSettings = TheImageSimulation.GetSettings()
    
    analysisSettings.ModifySettings(cfg, 'ISM_INPUTFILE', "Text_100p_3x3_2_g1196x1279_dist.png")
    analysisSettings.ModifySettings(cfg, 'ISM_FIELDHEIGHT', '15')
    analysisSettings.ModifySettings(cfg, 'ISM_FLIPIMAGE', '3')
    analysisSettings.ModifySettings(cfg, 'ISM_OUTPUTFILE', 'Test1.png')
    
    analysisSettings.LoadFrom(cfg)

    a = TheImageSimulation.ApplyAndWaitForCompletion()
    b = TheImageSimulation.GetResults()

 

 

after running the code, the “a” said “ successfully unlocked Spatial components”

I don’t think it went successful because it was completed too soon ~ 10 sec (it takes 1 or 2 minutes in zemax)

Could you guide me on how to debug this situation?

Thanks.

Be the first to reply!

Reply