Skip to main content
Solved

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

  • April 11, 2022
  • 2 replies
  • 291 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

2 replies

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 402 replies
  • Answer
  • April 11, 2022

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
  • 2 replies
  • April 11, 2022

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.