Skip to main content
Solved

Getting the row's Value column in MFE using ZOS-API

  • Apr 11, 2022 5:26 AM UTC
  • 2 replies
  • 391 views

AminR
Forum|alt.badge.img+1

Hi

I am learning how to build the MFE with ZOS-API and for that I am creating a simple MFE. I know that Target and Weight are accessible through 

 

Operand.Weight

Operand.Target

 

But calling the Value column using

 

Operand.Value

 

returns 0.

 

Any idea what I am doing wrong?

 

Thanks

 

Best answer by MichaelH

Hi Amin,

Did you call TheSystem.MFE.CalculateMeritFunction() before Operand.Value?  Before OpticStudio calculates the value of an operand, it will always be 0 and you need to refresh the MFE to get the actual value.

~Michael

View original

2 replies

MichaelH
Luminary
Forum|alt.badge.img+2
  • Luminary
  • Answer
  • Apr 11, 2022 4:44 PM UTC

Hi Amin,

Did you call TheSystem.MFE.CalculateMeritFunction() before Operand.Value?  Before OpticStudio calculates the value of an operand, it will always be 0 and you need to refresh the MFE to get the actual value.

~Michael


AminR
Forum|alt.badge.img+1
  • Author
  • Monochrome
  • Apr 11, 2022 4:57 PM UTC

Hi Amin,

Did you call TheSystem.MFE.CalculateMeritFunction() before Operand.Value?  Before OpticStudio calculates the value of an operand, it will always be 0 and you need to refresh the MFE to get the actual value.

~Michael

Thanks Michael. I did not know to use this function. Problem solved.