ZPO & ZSO

Objects utilizing gallery data and sketches created in the Gallery Mode and Sketch Mode's, respectively, must be saved using the extension, ZPO.  The ZSO file is a readable text file only capable of saving a script.  The ZPO in many ways is much more robust, allowing for the creation of more complicated parts with "Sketch Object" commands.  ZPO's may also be saved with Gallery Data (accessed in "File"-> "Save Gallery Data").  This information is user defined and is optional.  ZSO's and ZPO's without gallery data will not be exposed in the gallery mode viewer.  Saving new parts with the ZPO extension is recommended even if gallery and sketch data are not needed.

Part Creation

The console acts as a text editor in a coding environment.  Each line of the console can accept one command.

When typing a command, the syntax for the command will be displayed at the bottom of the console for reference.

Note that this display is static, and cannot be selected (i.e. clicked on) in order populate the actual contents of the console. In other words, the display is not meant to provide "Intellisense"-level functionality, but does provide an easy way to review the syntax for any command.

The syntax for the ZPD script is as follows:

Declaration commands. To define numerical values used elsewhere in the script the general syntax is:declaration new_name, value

Object creation commands. To create a new object, the general syntax is:object_type_name new_object_name, arguments

Operation commands. To operate on an existing object, the general syntax is:operation_type_name existing_object_name, arguments

Computation commands. To compute data about an existing object, the general syntax is:computation_type_name new_data_name, arguments

The Zemax Part Designer allows for commented lines by placing an exclamation point in front of the commented line.  Like in any coding environment, Zemax Part Designer also allows users to perform calculations within a command.  For example:

PARAMETER radius, 10
CONSTANT radius2, (radius*0.5)+1

These calculations may also be used in the creation of all geometries and within the "Insert" dialog options.

Next: