Solved

Prescription data import

  • 3 February 2024
  • 8 replies
  • 71 views

Badge

I have been asked to re-create a Zemax design from 2007.  All they have is the Prescription data text file.  Is there  a tool to import this data from the ascii file?  I think I saw such a feature, but can’t find it now in OS.  I enter the data manually, but direct import/conversion would be easier & more accurate.

icon

Best answer by Mark.Nicholson 4 February 2024, 21:42

View original

8 replies

Userlevel 7
Badge +3

I don’t believe there’s any such tool.

Badge

Thanks Mark, I had a faint recollection that a tool existed, but it could have been a dream-wish.  Maybe some user has made one themselves.

Seems like it would be easy to reverse what they do when they create the Rx data file.  I’m slowly doing it by the old hunt & peck method:(

Charlie

Userlevel 3
Badge

You can try to open it Excel and copy-paste rows with radiuses/thickness/glasses to Zemax.

Badge

Thanks Andrey, I’m using the cut/paste method with a text editor.  I thought someone might have created a tool to parse the Rx files.  I thought I had seen one, but can’t remember where.

Userlevel 3
Badge

I see. But if you use a text editor you need to copy value by value. In Excel you can copy several values so you’ll get less steps. 

Badge

Thanks, you are right, I’ll give it a try.

Charlie

Userlevel 3
Badge +1

You could write a ZPL macro to read the values from the text file. I guess it comes down to whether this is a one-time effort to determine if it would be an efficient solution for you. I used to have a macro for this purpose when I was responsible for updating my company’s lens catalog. Good luck!

Userlevel 7
Badge +2

In this post:

I have a Python code snippet that I used to parse a patent lens, and fill my lens file accordingly with the ZOSAPI. Its a bit rough but I guess it could be a starting point.

Take care,

 

David

Reply