Skip to main content
Solved

Reading surface comments in OpticStudio 23.1

  • March 14, 2023
  • 1 reply
  • 250 views

Forum|alt.badge.img

I am trying to update and use a set of Python scripts. The code used to retrieve surface comments from the Zemax model no longer seems to work in OpticStudio 23.1. This code was all written several years ago, so uses the older win32com library rather than the newer preferred .NET approach, but it does still work on another computer running OpticStudio 22.1, so has something changed in the API definitions over the past year?

surface_name = system.LDE.GetSurfaceAt(k).Comment

doesn’t return a string, but <COMObject Comment>, and I can’t work out how to actually get the string out of this.

The script works if I replace this line with 

surface_name = str(system.LDE.GetSurfaceAt(k).GetSurfaceCell(1))

While this fixes the problem, it’s obviously less readable, and I’m not sure why this change is needed. Any suggestions on why the original code isn’t working any more?

 

Best answer by Sahil

Hello Stephen,

Thanks for your question.

Their is a bug for OpticStuidio 23.1. I have reported the bug to our product team.

Actually in LDE,I have explained below accessing the first column from API  resulting next column as shown below.

 

 

Thanks

Sahil

View original
Did this topic help you find an answer to your question?

1 reply

Sahil
Forum|alt.badge.img+1
  • Visible
  • 22 replies
  • Answer
  • March 28, 2023

Hello Stephen,

Thanks for your question.

Their is a bug for OpticStuidio 23.1. I have reported the bug to our product team.

Actually in LDE,I have explained below accessing the first column from API  resulting next column as shown below.

 

 

Thanks

Sahil


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings