Hello,
I am working on a macro as described in the following article, but converted in Python:
As working directly on the system, each modification saves an UNDO file and the action is repeated for each Zernike coefficient, for each surfaces, that slows down the execution.
The actual way :
Get the system with :
TheSystem = TheApplication.PrimarySystem
and work on it directly
I tried to get a copy of the system with the CopySystem function, modify the copy and push it back :
TheSystem = TheApplication.PrimarySystem
new_system = TheSystem.CopySystem()
# does work here
TheSystem = new_system.CopySystem()
When looking at the surface type of TheSystem, I can see that it changed correctly, however it is not applied in the Zemax main window.
I used the TheSystem.UpdateStatus() function, but does not help.
Ideally my goal would be to be able to make all modifications outside of Zemax and update it when done, and hence get only one step of UNDO.
Is it possible in Python ? If so, what did I missed ?
Would that be possible in C# ?
Thank you for your help.