Skip to main content
Solved

SETNSCPOSITION/ SETNSCPARAMETER In ZPLM


  • Visible
  • 22 replies

Hello,

 

I want to push into my model an input file with data regarding new position/ parameters.

When I execute the ZPL code through the GUI (Programing>Edit/Run, F9) it works just fine, but when I try to execute it through the merit function with a ZPLM row it seems that the SETNSCPARAMETER/ SETNSCPOSITION just isn’t working.

I know the MFE is executing the ZPLM since I made a debug output which looks just fine, feels like I’m missing something very basic.

Code snippet:

1OPEN INPUT_FILENAME
2OUTPUT OUTPUT_FILENAME
3READ NUM_OF_PARAMS NUM_OBJ
4PRINT NUM_OF_PARAMS, " ", NUM_OBJ
5FOR II, 1, NUM_OF_PARAMS, 1
6 READ PARAM_NUMBER PARAM_VALUE
7 PRINT PARAM_NUMBER, " ", PARAM_VALUE
8 SETNSCPARAMETER 1, NUM_OBJ, PARAM_NUMBER, PARAM_VALUE
9NEXT
10CLOSE

 

An input/output example of the code above:

1## INPUT ##
2
33 18
41 50
52 50000.0
63 0.005
7
8## OUTPUT ##
9
103.0000 18.0000
111.0000 50.0000
122.0000 50000.0000
133.0000 0.0050

 

Edit: Wanted to point out that my ZPL files are located in Zemax/Macros

Best answer by Ray

I think this section of the manual may apply to your case:

 

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

2 replies

Forum|alt.badge.img
  • Fully Spectral
  • 109 replies
  • Answer
  • July 17, 2023

I think this section of the manual may apply to your case:

 


  • Author
  • Visible
  • 22 replies
  • July 17, 2023
Ray wrote:

I think this section of the manual may apply to your case:

 

 

So, I’ve tried bypassing this limitation my making a ZPLM that creates a new object row, assigns a ZPL Macro solve on one of its parameters, and that solve is doing the work I mentioned above.

This did not solve the behavior shown above as it still wouldn’t work when running it through the MFE.

 

Oran


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