There are times when the current built-in optimization operands might not correspond to the data you wish to return/optimize for.  With the flexibility of the ZPLM and User Defined operands, data can be calculated or extracted from a user-defined macro or program and returned to the Merit Function Editor.  Macros, the simpler of the two solutions, are well integrated within ZEMAX and require little programming experience. 

References

ZEMAX Optical Design Program User’s Guide, ZEMAX Development Corporation