To demonstrate this capability, we will start with the “Double Gauss 28 degree field.zmx” file located in your ZEMAX>Samples>Sequential>Objectives folder.

Open this file and open a Shaded Model plot (Analysis > Layout > Shaded Model).  In the settings, click the “Reset” button (in case you have previously saved settings which are not the ZEMAX defaults), and then change the Rotation X and Rotation Y values to 10 and 10 degrees, respectively.

Shaded Model Settings

Once the values have been set, save the settings by clicking the “Save” button.

When the “Save” button is chosen, ZEMAX creates a configuration file with the lens file name (in this case, the file is “Double Gauss 28 degree field.CFG”) as well as a configuration file specific to the chosen analysis feature (for the shaded model, this file is called LSH.CFG).  The LSH.CFG file exists within the main ZEMAX directory.  The lens specific configuration file is saved in the same path as the currently opened lens file.

When changing the settings within the macro language, you must modify the analysis-specific configuration file, e.g. LSH.CFG, and not the lens configuration file.

Note: To ensure that the analysis-specific configuration files located in the main ZEMAX directory are not perturbed, you may copy and paste the necessary configuration files into a temporary folder, and then use these files in the macro. You may of course also choose to modify the configuration files located in the main ZEMAX directory with the macro, as illustrated in example provided in the next section.