Retrieving Surface Parameter Values in Lens Data Editor through ZOS-API

  • 30 September 2020
  • 2 replies
  • 573 views

Userlevel 5
Badge +1

In the ZOS-API, how can I modify values for a surface definition that correlate to 'Par 0, Par 1', etc., such as higher order terms for the Even Asphere?


2 replies

Userlevel 5
Badge +1

In the API, one way to get data that is common to most of our sequential surface types, like Radius of Curvature or Thickness, is obtainable by starting with the GetSurfaceAt() function within the ILensDataEditor interface. This will return an object within the ILDERow interface:

 




 


In MATLAB, obtaining the first surface as an object within the LDERow interface might look like as follows:

 


TheSystem = TheApplication.PrimarySystem;

TheLDE = TheSystem.LDE;

Surface1 = TheLDE.GetSurfaceAt(1);



From here, we can obtain the common data between sequential surfaces using the following properties:

 




 


Retrieving and setting the Parameter values, however, is a little different. One of the most direct ways to deal with this is to use the GetCellAt() function:

 




 


With this method, we'll have to specify the column value itself based on the column location in the spreadsheet, which includes all of the common data (the following screenshot is using the Express View to show the 'Par 0' column which is accounted for in the indexing of the LDE):

 





So, you can use GetCellAt() to retrieve a specific cell in your spreadsheet, and subsequently use the IEditorCell interface properties to get and set Parameter Values (and you can also retrieve the header for that cell from here as well!):

 


% Use GetSurfaceCell() to retreive data under '2nd Order Term'

surf1_Par1 = Surface1.GetCellAt(12);

surf1_Par1_header = char(surf1_Par1.Header);

surf1_Par1_val = surf1_Par1.DoubleValue;





 


Of course, this is just one way to retrieve this set of information. Another function in the ILDERow interface called GetSurfaceCell() behaves very similarly, but requires the use of enumerated values to select the column of interest:

 




 


For some demonstration on how this function works, you can take a look at the following Knowledgebase articles:



~ Angel

Userlevel 1

Is there anyway to get the surface type?

 

Edit:

Nevermind, I got it.  In python I did

`surfprop = TheSystem.LDE.GetSurfaceAt(x).TypeName`

Reply