Skip to main content

Access to field "Convert To" function in ZPL macro


Forum|alt.badge.img

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.

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

Nicholas Herringer
Zemax Staff
Forum|alt.badge.img+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


Forum|alt.badge.img

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.


Kevin Scales
En-Lightened
Forum|alt.badge.img+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


Forum|alt.badge.img

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.


Kevin Scales
En-Lightened
Forum|alt.badge.img+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


Kevin Scales
En-Lightened
Forum|alt.badge.img+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


Jay.Bernal
  • Monochrome
  • February 10, 2025
Nicholas Herringer wrote:

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

 

I’m interested in this topic but I couldn’t access the link provided here. Can you please advise?

 

Thanks,

Jay


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