Skip to main content
Solved

"GetNSCPosition" is not recoganize in ZPL


I applied a solve on position z by 'SOLVETYPE'. Then I need to refer to the result of solve, i.e. the position os z. 

I am trying to using 'GETNSCPOSITION'. According to the EXTENSION DATA ITEMS, this should return the object position and angle and material. However, the viewer shows 'Unknown symbol GETNSCPOSITION.'

The similar command 'SETNSCPOSITION' works fine. But not the GETNSCPOSITION. It seems in the editor, it does not recoganize it as a legal command

Can anyone help something is wrong?

Thanks.

Best answer by Csilla Timar-Fulep

Hello Xin,

The problem is that GetNSCPosition is - as you said - an extension data item, not a ZPL keyword. Therefore, it cannot be used in a macro.

In order to get the position of an NSC object in a ZPL macro you need to use the numeric function NPOS():

To extract the z-position, you need to use code 3.

Best,

Csilla

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

2 replies

Csilla Timar-Fulep
Zemax Staff
Forum|alt.badge.img+2

Hello Xin,

The problem is that GetNSCPosition is - as you said - an extension data item, not a ZPL keyword. Therefore, it cannot be used in a macro.

In order to get the position of an NSC object in a ZPL macro you need to use the numeric function NPOS():

To extract the z-position, you need to use code 3.

Best,

Csilla


  • 0 replies
  • June 26, 2020

Hi Csilla, this is great! Thanks a lot. 


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