Question

Filter String automatic update

  • 19 February 2024
  • 1 reply
  • 35 views

Userlevel 2

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?


1 reply

Userlevel 3
Badge +1

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!

Reply