Skip to main content

highlighted selected surface index

  • September 8, 2020
  • 3 replies
  • 76 views

Hello Everybody,


is it possible through the api, to get the surface Index from the highlighted or selected surface?

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

3 replies

Csilla Timar-Fulep
Zemax Staff
Forum|alt.badge.img+2

Hello Luca,


Thanks for your question here!


You may access the index of the selected surface by using the GetSelectedSurface() member function of the ZOSAPI.SystemData.ISurfaceSelection Interface, please see the documentation from the ZOS-API Syntax Help below:



Best, 


Csilla


  • Author
  • Monochrome
  • 3 replies
  • September 10, 2020

Hello Csilla and thank you for your reply. 


There's not IZOSAPI_Application.PrimarySystem.SystemData.ISurfaceSelection.GetSelectedSurface()  function. The only function I found is ZOSAPI_Application.PrimarySystem.SystemData.Aperture.GCRS.GetSelectedSurface() but it always returns the stop surface index. 


How can acces the ISurfaceSelection interface?


Thank you


Csilla Timar-Fulep
Zemax Staff
Forum|alt.badge.img+2

Hello Luca,


Sorry for the misunderstanding.


The SurfaceSelection works for the Global Coordanite Reference Surface of your system.



By calling TheSystem.SystemData.Aperture.GCRS.GetSelectedSurface() it will return the global coordinate reference surface. You may change this global reference by setting a surface number directly, or you may set the object, the stop, or the image surface to use it as a reference.


As far as I know it is not possible to interact with the Lens Data Editor and retreive which surface is selected there, if there is one.


If you have any further questions, please let us know and we will be happy to help!


Best regards,


Csilla


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