# How to use a zpl macro to set the Decenter X,Y of a coordinate break surface

• 201 views

• Monochrome

I have already searched for an answer in the knowledgebase, and searched the documentation.

### Problem:

• I am using coordinate breaks to generate a system with off-axis illumination.

• I want to step through a series of geometries using a macro to find the optimum geometry.

• This requires that I control the the Decenter Y of a couple of coordinate break surfaces.

• The command SETSURFACEPROPERTY does not appear to modify this parameter in the Lens Data using either

- parameter 62 (before decenter y)

- parameter 72 (after decenter y)

• There are no other supported commands listed for setting decenter, and no other keywords for controlling the parameters in the lens data.

• There are some obsolete commands such as PARM, but there is no documentation

### Example:

```
inter_optic_distance = 5
beam_diameter_in = 5
FORMAT 1.12
FOR magnification, 3, 8, .5
!determine the output beam diameter based on the selected magnification
beam_diameter_out = beam_diameter_in/magnification
decenter_y = (beam_diameter_in/2 + beam_diameter_out)*1.2
print "Output beam decenter ", decenter_y

!determine the radii of the two mirrors, such that the inter-optic distance is fixed
radius_primary = inter_optic_distance * 2 / (1-1/magnification)
! Set the curvature of the primary and the secondary
SETSURFACEPROPERTY  3, CURV, curvature_primary
SETSURFACEPROPERTY  5, CURV, curvature_secondary

!set the Decenter Y of the coordinate break controlling the off-axis distance
SETSURFACEPROPERTY  1, 72, decenter_y
! run the optimization routine
OPTIMIZE
! Get the figures of merit for this magnification from the merit function editor
val01 = OPER(5, 10)
! ... and so on

PRINT magnification
PRINT val01, " "
! ... and so on

PRINT

NEXT```

Userlevel 2
+1
Hi Ben,

You need to use `SETSURFACEPROPERTY` , but instead of using code 62 or 72 (which control values inside the Surface Properties dialogue) you need to use code 10 which allows you to change the value of parameters in the LDE

For  coordinate break surface the y-decentre is parameter 2

So your code might look something like:

```
!set the Decenter Y of the coordinate break controlling the off-axis distance
SETSURFACEPROPERTY  1, 10, decenter_y, 2```