Access to field "Convert To" function in ZPL macro

  • 16 July 2020
  • 6 replies
  • 145 views

Badge

Is there a way to access the field 'Convert To' function in a ZPL macro?  If not, can this be added to the new features list?


Thanks.


Pat.


6 replies

Userlevel 2
Badge +1

Hi Pat, 


There is not currently a way to leverage the 'Convert To' functionality directly via a ZPL macro. That said, it is possible to build this conversion into a ZPL macro by leveraging the SETSYSTEMPROPERTY Keyword and using some of the single ray trace operands. For example, to convert from a field type of Angle to Real Image Height, you could use the REAX/REAY operands to return the chief ray landing coordinates for each field on the image plane; then, pass these values into the SETSYSTEMPROPERTY keyword to change the Field x-/y-coordinates and then change the field definition. 


That said, if you're familiar with using the ZOS-API, you can leverage the 'Convert To' functionality directly. To do this, you can use the ConvertToFieldType() command in the ZOSAPI.SystemData namespace, under the Fields class. Generally speaking, the ZOS-API is a much more powerful (albeit complex) tool for programming OpticStudio, so if you're comfortable with it, I'd recommend going that route. If you're not familiar with the API, check out the ZOS-API Learning Path here.



Let us know if you have any questions here, and if so, we'll be more than happy to help.


Cheers,


Nick

Badge

Nick,


Thanks for the info.  For long time ZPL users, do you have any plans of supporting new ZOS features in ZPL or is this a low priority due to their access in API?


Thanks.


Pat.

Userlevel 4
Badge +1

Hi Pat,


My sense is that this sort of thing would be a low priority. I have checked the feature request list and don't see anything like this. Given the much stronger capabilities OpticStudio has through API, it is unlikely that ZPL will incorporate it soon.


If we hear otherwise at any point, someone will be sure to let you know.


Kevin

Badge

Kevin,


Thanks for the info.  I understand but the response I got from Zemax support (attached) seems to imply that I'm not the only one that asked to put this on the feature request list.


Thanks again.


Pat.

Userlevel 4
Badge +1

Pat,


I'm not sure where that feature request is located. I will ask the engineer who sent you that response where he saw it. If there is one, we can certainly add your request to it as he said.


Kevin

Userlevel 4
Badge +1

Pat,


I've spoken to the engineer you heard from. He had simply not gotten to filing your case yet. There is now a formal request on your behalf, as well as another user's (which was submitted on our old system a little while back).


Kevin

Reply