How to share an OpticStudio file

Authored By Alissa Wilczynski

Quick Guide

Sharing design files is an integral part of the optical product design workflow. This article describes the recommended steps to ensure that, when sharing OpticStudio files, all the necessary information is properly packaged for delivery. This includes instructions on how to use the Zemax Archive File and Project Directory structure (available in OpticStudio 21.3). 

To share an OpticStudio design, follow the steps below. More detailed information is included in the following sections.

  1. File...Save As. Create a new folder and save your OpticStudio lens file to this location.
  2. File...Convert to Project Directory. This will create and bundle project specific supporting files like Materials Catalogs.
  3. File...Create Archive. This is like zipping up all of the required files, whether they are located in the Zemax folder structure or your project directory. This creates a .ZAR file.
  4. Send the .ZAR to the desired destination.
  5. File...Load Archive on the destination machine. This will open the optical design exactly as it was saved on the source machine. 

Saving a lens file

If you have created a new model and are saving for the first time, select File...Save As. Create a new folder in the place where you would like all of your project data to be located. Give your file a name, and hit "Save." The default option is to save the file to the secure binary format (.ZOS). You can optionally save the file to the older text format (.ZMX) if desired, though doing so will generate a warning message, as ZMX represents an old file format. 


This will create a .ZOS (or .ZMX) and .ZDA file of your given name in the new folder. The .ZOS (.ZMX) file contains your lens prescription, and the .ZDA file contains your display configuration, open windows, and settings in the lens file. For more details, see What are the .ZDA and .CFG Files?.


Organizing supporting files with a Project Directory

Systems modeled in OpticStudio use a number of supporting files in addition to lens and session files. For a full list of the file types, extensions, and their uses, see the article Zemax file extensions.

In OpticStudio 21.3 or newer, it is recommended that you organize your files in the Project Directory system. Project Directories allow you to bundle important supporting files so that they can be easily accessed an manipulated on a project-by-project basis. For a detailed description of Project Directories, see the article Using project directories to organize OpticStudio files.

To create a Project Directory, navigate to File...Convert to Project Directory.


This will create additional folders for supported file types that are used in your model. To see a list of supported file types, refer to the OpticStudio Help Files.


Packaging files with an archive (.ZAR) file

It is possible that not all of the files used in your system are contained in the Project Directory. For this reason, it is not recommended that you zip your Project Directory folder to share it with someone else. Instead, create a Zemax Archive File (.ZAR) by clicking File...Create Archive. An archive file packages all of the files required for your design, whether they are located in the Zemax folder structure or your project directory. 


You can save your archive file within your project directory, to keep all your files for this system together. Alternatively, it can be saved to any location; with a small number of exceptions (listed below), the archive file contains everything related to your system, so it does not need to be co-located with any other files in order to function.


Archive files do not contain the following files:

  • Zemax Programming Language Macros (.ZPL)
    • Macros used within a ZPL solve or ZPLM merit function operand will be included in the archive
  • Tolerance Scripts (.TSC)
  • Tolerance Files (.TOL)
  • Merit Functions (.MF)
  • Grid Sag/Grid Phase Data Files (.DAT)

Opening an archive file

To open a Zemax Archive File, click File...Load Archive from inside OpticStudio. The .ZAR can be located anywhere readable; its location is not important.

If you'd like to create a new Project Directory, in the "Restore from Zemax Archive (ZAR) File" window, select Browse in "To Folder:" setting. In the following window, create a new folder to host the Project Directory and then click OK.


Upon loading, the files in the archive will be copied to their new folder location, and then the system will open in OpticStudio. The system maintains the same project directory setting as the original. For more information on project directories, see the article Using project directories to organize OpticStudio files.


Error messages

While loading an archive file, it is possible that you will see the message below.

The ZAR file was made by a newer version of OpticStudio/OpticsViewer than the one currently running and cannot be restored.


If you receive this message, it likely means that the archive file contains a binary ZOS file and that you are running a version of OpticStudio that predates OpticStudio 21.3. Binary ZOS files are incompatible with earlier versions of OpticStudio. To resolve this issue, you can:

  1. Download and install an OpticStudio version that postdates OpticStudio 21.3.
  2. If you cannot install a newer version, ask the person who originally shared the file to save it to the ZMX format.  





Was this article helpful?
3 out of 4 found this helpful



Article is closed for comments.