Skip to main content
Solved

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


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
Did this topic help you find an answer to your question?

2 replies

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 342 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
MichaelH wrote:

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.


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