How to pass more parameters to a User-Defined Surface DLL?

  • 12 February 2021
  • 3 replies
  • 42 views

Userlevel 5
Badge +2

A user-defined surface DLL will retrieve information from OpticStudio via the FIXED_DATA5 structure defined in the header file. An example of the header file can be found under '\Zemax\DLL\Surfaces\usersurf.h'.


To access the surface parameters, the DLL reads the variable param in the FIXED_DATA5 structure:



If we need to pass more parameters to the DLL, one way can be to use the datasurf_numvalues and datasurf_values.



To use this, a 'Data' surface has to be used.


Below I have taken a screenshot when debugging a user-defined surface:



I hope this helps but do not hesitate to share your comments.


Sandrine


3 replies

Can you please explain what's the purpose of 'alternate sag'? Is that another surface required for fresnel lens dll?

While Iam debugging, I always become Polarizaion Data (Exr, Exi, Eyr, Eyi, Ezr, Ezi) parmmetrs equal to zero.


I can not test if teh Electric field that i have modified is right. 


Coul you help me?


 

Userlevel 5
Badge +2

test

Reply