Skip to main content
Question

Unable to use the raydatabase and filter on NSC detectorviewer in ZOS API

  • June 30, 2025
  • 1 reply
  • 13 views

mocquin
Ultraviolet

I don’t understand how I should set the Filter and RayDatabaseFile of the DetectorViewer in non-sequential mode.

SHould I use : 

DetectorView = zos.system.Analyses.New_DetectorViewer()

or :

DetectorView = zos.system.Analyses.New_Analysis(zos.ZOSAPI.Analysis.AnalysisIDM.DetectorViewer)

Then should I use :        

settings = DetectorView.GetSettings()

and/or ?

        settings = zos.ZOSAPI.Analysis.Settings.RayTracing.IAS_DetectorViewer(settings)

Then using : 

        settings.RayDatabaseFilename = db_file

        settings.Filter = "h9"

Those seems to make the analysis fail

       

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • July 15, 2025

First, make sure your system is in non-sequential mode before opening the Detector Viewer.  You can use TheSystem.MakeNonSequential().

You can use either New_DetectorViewer() or New_Analysis(); underneath the hood, these are the exact same method with the ZOS-API.  I personally like using New_Analysis_SettingsFirst() since this will open the analysis without running it first (there are some long-running analysis like POP that this could make a difference).

As for the settings, you should use DetectorView.GetSettings().  The IAS_DetectorViewer is an interface and cannot be used like a method.  If you’re using Python, it’s always a good idea to cast the parent implementation of the setting via DetectorView.GetSettings().__implementation__ (this will inherent any methods from the IAS_ parent interface like Field, Wavelength or Surface if the analysis has these implemented).

Finally, the ZRD file should be in the same folder as the non-sequential ZMX file.  If you haven’t loaded a ZMX file, then the default folder will be Documents\Zemax\Samples.

 


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