You need to write a separate C or C++ program and compile and link it into ZEMAX DLL (dynamic link library). An America company can do it for you but quite expensive. It's a pity that I have not used C/C++ for long time. If anyone knows C/C++, you can get money by doing this.
I have used C/C++ for a long time, so I can do this job independently. But I want to know how I should write the C/C++ program? That is how can I get the frame of this program?