The attached ZPL will calculate the air space gaps between all elements and then will place the annotation text on the Windows clipboard. After you run the script, simply open the Edit Annotation window, paste the text and click the Use Annotations checkbox:
For the Double Gauss 28 degree field.zmx, the 3D Layout will look like:
and for the Cooke 40 degree field.zmx:
Limitations:
- You have to use the 3D Layout and not the 2d Layout. The 3D Layout uses global coordinates for annotations while the Layout uses “window” units, meaning the values for LINE and TEXT would change based on the current zoom position.
- For complete control, you should use LINE3D and TEXT3D (this would allow you to place things like Comment, Radius, or Material on the plot as well. For this simple example of air spaces, we will use MEASURE3D which is slightly easier to implement.
- Since we're only looking at air spaces, you need to consider when you “enter” a cemented element (doublet, triplet, etc) and when you “exit” the element. You cannot simply cycle through the LDE and look at the elements with something in the Material column.
- This becomes much more difficult when you’re using off-axis, freeform, or folded systems since you need to calculate the placement of the lines/text in 3D space rather than just 2D space.
- Since the annotations places the text on a defined plane, you need to know which Camera View Projection you're using. This script uses the YZ plane.