Skip to main content
Solved

Solutions to hide details of a ZPL macro

  • November 23, 2023
  • 3 replies
  • 132 views

xavier_bth

Dear Zemax community,

I currently have a ZPL macro that has two inputs taken from the MCE and computes the radius of curvature of a surface, based on these two values. What is useful is that I can set my two inputs as variables and run some optimization so i’m quiet happy about it.

Now I would like to hide the equation so that my zemax file performs the same but no one can access the details of the computation within my ZPL macro. I understand there is no way to encapsulate a ZPL macro or create a black box around it. What other options do I have that would work in the same fashion as this ZPL macro?

Thanks

Best answer by Andrey.Pravdivtsev

I suppose you couldn’t run ZOS-API from ZPL.

You can try to create a DLL surface based on the standard surface and put the equation there.

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

Mark.Nicholson
Luminary
Forum|alt.badge.img+3

Is your macro implemented as a macro solve? In that case, I don’t think you have any options for obfuscating the file.

If its something you only run once (or some small number of times) you could use ZOS-API to produce a .exe that does the same thing. That would be a binary file so unreadable, and could be further obfuscated if you really need it. 


xavier_bth

Dear Mark,

My issue is that it is indeed a macro solve. My output is the radius of a surface which changes based on the two input parameters in my MCE. I am often using either one of these two parameters to run optimizations in Zemax as well.

Do ZOS-API need to be manually executed or can you call them from a ZPL macro?


Forum|alt.badge.img

I suppose you couldn’t run ZOS-API from ZPL.

You can try to create a DLL surface based on the standard surface and put the equation there.


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