Hello Michael,
Great macro. I wish this could also support Fold mirrors/non-axial systems as well. This macro makes it so much easier to share the basic layout information.
I think OpticStudio should have this as inbuilt feature by default.
Best - AS
This macro doesn’t seem to work for me any longer. I’m on 2024R1.03. Does anyone know if this should work on the latest version?
Also, Has anyone made a version that enumerates lens surfaces? CodeV does this and it makes communicating specifics about the lens design easier.
Thanks,
John
@John.Hygelund
The macro seems to work on my side in R1.00. Could you tell us more about your issue? What is not working exactly? The macro is mostly based on text and relatively simple math, I find it hard to believe that an update has broken it. What I think is more likely is an issue with Windows.

I’ve looked at @MichaelH macro’s and aside from it being extremely well-thought, its core concept is to put the annotations in the clipboard through a shell command. This is really convenient, but you could also OUTPUT the annotations to a text file and copy them from there. I’m not at all expert in this area, but could it be a cyber-safety feature that prevents the execution of BAT files on your PC? You can comment the line where @MichaelH deletes the BAT file (once it has copied data into the clipboard) and print the path to this file. You can then navigate to this file and inspect its content.
- Comment the line 145, which deletes the BAT file, by adding a
# in front of the line:
#DELETEFILE tf$ - In line 95, add the following line to print the path to the BAT file:
PRINT tf$ - Save and Run the macro
- In the Text Viewer, find the path to the BAT file towards the end:

- Open the file and check its content (right-click the file and open with a text editor), it should look like so:

As you can see, the first line clears your clipboard. Then, all that’s between the parenthesis is put into your clipboard. That is what should happen when this file is executed, which by the way, you can also execute by double-clicking on it.
I hope this helps, and take care,
David
Hello @David.Nguyen ,
Thanks for confirming that the macro works for you. I should have been more specific: the macro runs, but nothing is copied to the clipboard. As you mentioned, this is probably a Windows limitation. Your suggestion to save and access the .bat file works perfectly.
Now, I need to think about adding surface numbers…
Thanks again. Your responses have been very helpful.