I need to be able to scale a section of a lens system from surface Sj to Sn from within a ZPL macro during optimization. Surface 3 in this system is in collimated light and initially set to 1.0, and can be changed in optimization to scale S7-S9 without affecting the system. The thing being optimized is the S7-S9 EFL. I tried using this macro with no luck. I found no SETSCALE or similar ZPL keyword. How to do this? Thanks, Mike
# ZPL20.ZPL
# USE T3 IN LENS FILE AS SCALING FACTOR FOR L1/L2 DOUBLET
T3 = THIC(3) # Varies from unity during op
R7 = RADI(7) * T3
R8 = RADI(8) * T3
R9 = RADI(9) * T3
T7 = THIC(7) * T3
T8 = THIC(8) * T3
OPTRETURN 0, T3
OPTRETURN 1, R7
OPTRETURN 2, R8
OPTRETURN 3, R9
OPTRETURN 4, T7
OPTRETURN 5, T8