The python 2to3 tool cannot be applied directly to ZEN macro files in *.czmac format since they are XML files that contain Python code in one of its XML elements. For these macros we have provided a script on the ZEISS Github page which automatically converts an input macro (*.czmac) file from python2 to python3 syntax.

  1. The 2to3 tool is available on your PC.
  1. Go to the ZEISS Github page and download ZeissMacroConverter.py. To batch-convert all macro files in a specified directory, additionally download ZeissMacroBatchConverter.py. If you download the batch file, store it at the same location as the other file.
  2. The files for conversion are available.
  3. Use the command line and call the python script from command line with the parameters -i (with the path to the file that needs to be converted) and -o (with the path to where the converted file needs to be stored, which can be the same as input file path). Example for converting a script called analysis time.czmac: D:\>python "D:\temp\macro\ZeissMacroConverter.py" "D:\temp\macro\analysis time.czmac" -o "D:\temp\macro\analysis time_converted.czmac"
  4. The respective macro is converted.
  5. To batch-convert macros with the ZeissMacroBatchConverter.py, you need to specify the path to the root folder containing the OAD macro files, for example: D:\>python "D:\temp\macro\ZeissMacroBatchConverter.py" "C:\OAD_Macros"
  6. All macros in the folder are converted.