Converting OAD Macros in *.czmac Format
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.
- The 2to3 tool is available on your PC.
- 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.
- The files for conversion are available.
- 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" - The respective macro is converted.
- 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" - All macros in the folder are converted.
ABOUT ZEISS
Impressum
Carl-Zeiss-Strasse 22
73447 Oberkochen
Germany
Legal