Skip to main content
Solved

Filter String automatic update

  • February 19, 2024
  • 3 replies
  • 110 views

Alberto.Donazzan
Ultraviolet

I noticed the Filter String in NSC Layout is not automatically updated when a new object is inserted in the NSC Editor. More specifically, I wonder why the object numbers are not updated automatically in the Filter String when a new object is inserted.

Is this something in the to-do list of Zemax developers? Or, instead, is auto-update unwanted for some reason?

Best answer by Kevin Scales

The filter string does not auto-update for the reasons alluded to. It is a bit of text that can be read and parsed into additional restrictions on the displayed data, and is stored and handled differently than parameters or properties. I couldn’t say why this is done this way, but I’m not aware of plans to change it.

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

3 replies

Sean Turner
Fully Spectral
Forum|alt.badge.img+1
  • Fully Spectral
  • 97 replies
  • February 21, 2024

It is certainly annoying that filter strings do not update when the NSC editor gets updated, and I don’t think there is anything in the help file indicating the filter strings do not update automatically. I don’t believe the filter string has any connection to the NSC Editor, but I have no idea how the Zemax OpticStudio source code actually works, so this is all just based on personal experience. Merit function, tolerance, multi-config operands, and pickups are all set up with an input for object number when appropriate. This makes it easy to be linked directly to the NSC editor, and update automatically with the NSC editor. Filter strings however, are just strings. In my primitive programming mind, I would imagine the steps to automatically update it would go something like this:

If the number of rows in the NSC editor changes: read the filter string, determine whether it contains a filter that corresponds to an object, extract the object number, compare it to the change in the NSC editor, determine whether a change to the filter string is necessary based on position in NSC editor, update filter string. 

Could filter strings be handled differently? I don't know. I don't think a universal “Filter String Editor" would be the answer because you may want different filters for different detector objects, layout windows, ray trace, etc.

I am curious to know if anybody has a unique solution to this!


Kevin Scales
En-Lightened
Forum|alt.badge.img+1
  • En-Lightened
  • 185 replies
  • Answer
  • April 23, 2024

The filter string does not auto-update for the reasons alluded to. It is a bit of text that can be read and parsed into additional restrictions on the displayed data, and is stored and handled differently than parameters or properties. I couldn’t say why this is done this way, but I’m not aware of plans to change it.


Alberto.Donazzan
Ultraviolet

Too bad there are no change plans.

Anyway, thank you both for your insights.


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