> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Example 03: Open File and Optimize

Ex 3: An API file (…\Samples\API\\\[language]\e01\_new\_file\_and\_quickfocus.zos) is opened, and some surfaces and radii are made variable.  A merit function which constrains air and material thicknesses, and targets astigmatism and coma, is generated manually by inserting operands and adjusting parameter values.  The local optimizer is run to completion, and then the hammer optimizer is run for 10 seconds.

```text theme={null}
Input:		API\[language]\e01_new_file_and_quickfocus.zos

Output:		API\[language]\e03_open_file_and_optimise.zos
```

[C#](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/apiexamples/example_03_cs)

[C++](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/apiexamples/example_03_cpp)

[Mathematica](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/apiexamples/example_03_nb)

[Matlab](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/apiexamples/example_03_m)

[Python](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/apiexamples/example_03_py)
