ZOSAPI.Editors.MFE.IMeritFunctionEditor Interface Reference
Last update: 17.07.2025This interface defines all properties and methods needed to interact with the MRit Function Editor. This interface can be accessed via the IOpticalSystem interface. More...

Public Member Functions | |
| IMFERow | GetOperandAt (int OperandNumber) |
| Gets the data for the specified operand. | |
| IMFERow | InsertNewOperandAt (int OperandNumber) |
| Inserts a new operand at the specified position. | |
| IMFERow | AddOperand () |
| Adds a new operand as the last operand in the system. | |
| bool | RemoveOperandAt (int OperandNumber) |
| Removes the operand at the specified location. | |
| int | RemoveOperandsAt (int OperandNumber, int numOperands) |
| Removes one or more operands at the specified location. | |
| bool | ShowMFE () |
| Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin. | |
| void | HideMFE () |
| Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin. | |
| void | SaveMeritFunction (string fileName) |
| Saves the entire merit function to the specified file. | |
| void | LoadMeritFunction (string fileName) |
| Replaces the entire MFE with the specified file contents. | |
| int | InsertMeritFunction (string fileName, int OperandNumber) |
| Loads a merit function from the file and inserts it at the specified location. | |
| string[] | GetMeritFunctionFiles () |
| Gets the merit function files in the default directory. | |
| double | CalculateMeritFunction () |
| Calculates the current value of the merit function. Note that this method is not asynchronous, and may take a long time to calculate in some cases. | |
| double | GetOperandValue (MeritOperandType type, int srf, int wave, double Hx, double Hy, double Px, double Py, double Ex, double Ey) |
| Returns the value of any optimization operand, even if the operand is not currently in the merit function. | |
| int | CopyOperands (int fromOperandNumber, int NumberOfOperands, int toOperandNumber) |
| Copy and paste the specified number of operands from one location to another. Note that it is okay for the source and destination to overlap. | |
| int | CopyOperandsFrom (IMeritFunctionEditor fromEditor, int fromOperandNumber, int NumberOfOperands, int toOperandNumber) |
| Copy and paste the specified number of operands from one location (in the specified system) to another location (in this system). Note that it is okay for the source and destination to overlap. | |
Public Member Functions inherited from ZOSAPI.Editors.IEditor | |
| IEditorRow | GetRowAt (int pos) |
| Gets the row at the specified index (0 to NumberOfRows-1). | |
| IEditorRow | InsertRowAt (int pos) |
| Inserts a new row at the specified index (0 to NumberOfRows). Note that some editors - such as the Lens Data Editor may not allow inserting new rows before the first row. | |
| IEditorRow | AddRow () |
| Adds a new row at the end of the editor. | |
| bool | DeleteRowAt (int pos) |
| Deletes a row at the specified index (0 to NumberOfRows-1). Note that all editors require at least one row, and some editors may require more than that. | |
| int | DeleteRowsAt (int pos, int numberOfRows) |
| Deletes one or more rows at the specified index (0 to NumberOfRows-1). | |
| int | DeleteAllRows () |
| Deletes all rows from the current editor. | |
| bool | ShowEditor () |
| Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin. | |
| void | HideEditor () |
| Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin. | |
Properties | |
| int | RowToOperandOffset [get] |
| Offset from a row index to operand index (always 1). | |
| int | NumberOfOperands [get] |
| Gets the total number of operands in the current system. | |
| MeritColumn | FirstColumn [get] |
| Gets the first available column. | |
| MeritColumn | LastColumn [get] |
| Gets the last available column. | |
| string | MeritFunctionDirectory [get] |
| Gets the default merit function directory. | |
| INSCOptimizationWizard | NSCOptimizationWizard [get] |
| Get the Nonsequential Optimization Wizard. | |
| ISEQOptimizationWizard | SEQOptimizationWizard [get] |
| Get the Sequential Optimization Wizard; note that this wizard is obsolete and you should use SEQOptimizationWizard2 instead. | |
| INSCBitmapWizard | NSCBitmapWizard [get] |
| Get the Mode-appropriate (Nonsequential/Sequential) Bitmap Wizard, Nonsequential ONLY. | |
| INSCRoadwayLightingWizard | NSCRoadwayLightingWizard [get] |
| Get the Mode-appropriate (Nonsequential/Sequential) Roadway Lighting Wizard, Nonsequential ONLY. | |
| ISEQOptimizationWizard2 | SEQOptimizationWizard2 [get] |
| Get the latest Sequential Optimization Wizard. | |
Properties inherited from ZOSAPI.Editors.IEditor | |
| EditorType | Editor [get] |
| Gets the type of this editor instance. | |
| int | NumberOfRows [get] |
| Gets the number of rows in this editor. Note that this referes to surfaces, objects, or operands depending on editor type. | |
| int | MinColumn [get] |
| The minimum column index that can be used in calls to IEditorRow.GetCellAt for any IEditorRow retrieved from this editor. | |
| int | MaxColumn [get] |
| The maximum column index that can be used in calls to IEditorRow.GetCellAt for any IEditorRow retrieved from this editor. | |
Detailed Description
This interface defines all properties and methods needed to interact with the MRit Function Editor. This interface can be accessed via the IOpticalSystem interface.
Member Function Documentation
◆ AddOperand()
| IMFERow ZOSAPI.Editors.MFE.IMeritFunctionEditor.AddOperand | ( | ) |
Adds a new operand as the last operand in the system.
- Returns
◆ CalculateMeritFunction()
| double ZOSAPI.Editors.MFE.IMeritFunctionEditor.CalculateMeritFunction | ( | ) |
Calculates the current value of the merit function. Note that this method is not asynchronous, and may take a long time to calculate in some cases.
- Returns
◆ CopyOperands()
| int ZOSAPI.Editors.MFE.IMeritFunctionEditor.CopyOperands | ( | int | fromOperandNumber, |
| int | NumberOfOperands, | ||
| int | toOperandNumber | ||
| ) |
Copy and paste the specified number of operands from one location to another.
Note that it is okay for the source and destination to overlap.
- Parameters
-
fromOperandNumber First operand number to copy (1 to NumberOfOperands). NumberOfOperands The number of operands to copy. toOperandNumber Row to start inserting the operands (1 to NumberOfOperands+1).
- Returns
- The number of operands actually copied.
◆ CopyOperandsFrom()
| int ZOSAPI.Editors.MFE.IMeritFunctionEditor.CopyOperandsFrom | ( | IMeritFunctionEditor | fromEditor, |
| int | fromOperandNumber, | ||
| int | NumberOfOperands, | ||
| int | toOperandNumber | ||
| ) |
Copy and paste the specified number of operands from one location (in the specified system) to another location (in this system). Note that it is okay for the source and destination to overlap.
- Parameters
-
fromEditor System to copy the operands from. fromOperandNumber First operand number to copy (1 to NumberOfOperands). NumberOfOperands The number of operands to copy. toOperandNumber To operand number (1 to NumberOfOperands+1).
- Returns
- The number of operands actually copied.
◆ GetMeritFunctionFiles()
| string[] ZOSAPI.Editors.MFE.IMeritFunctionEditor.GetMeritFunctionFiles | ( | ) |
Gets the merit function files in the default directory.
- Returns
◆ GetOperandAt()
| IMFERow ZOSAPI.Editors.MFE.IMeritFunctionEditor.GetOperandAt | ( | int | OperandNumber | ) |
Gets the data for the specified operand.
- Parameters
-
OperandNumber The operand number (1 to NumberOfOperands).
- Returns
◆ GetOperandValue()
| double ZOSAPI.Editors.MFE.IMeritFunctionEditor.GetOperandValue | ( | MeritOperandType | type, |
| int | srf, | ||
| int | wave, | ||
| double | Hx, | ||
| double | Hy, | ||
| double | Px, | ||
| double | Py, | ||
| double | Ex, | ||
| double | Ey | ||
| ) |
Returns the value of any optimization operand, even if the operand is not currently in the merit function.
- Parameters
-
type type of operand srf surface / integer parameter 1 wave wavelength / integer parameter 2 Hx hx / double parameter 1 Hy hy / double parameter 2 Px px / double parameter 3 Py py / double parameter 4 Ex Ex / double parameter 5 Ey Ey / double parameter 6
- Returns
- The computed value of the specified operand
◆ HideMFE()
| void ZOSAPI.Editors.MFE.IMeritFunctionEditor.HideMFE | ( | ) |
Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
- Returns
◆ InsertMeritFunction()
| int ZOSAPI.Editors.MFE.IMeritFunctionEditor.InsertMeritFunction | ( | string | fileName, |
| int | OperandNumber | ||
| ) |
Loads a merit function from the file and inserts it at the specified location.
- Parameters
-
fileName Name of the file. OperandNumber The position to insert the merit function at (1 to NumberOfOperands+1).
- Returns
◆ InsertNewOperandAt()
| IMFERow ZOSAPI.Editors.MFE.IMeritFunctionEditor.InsertNewOperandAt | ( | int | OperandNumber | ) |
Inserts a new operand at the specified position.
- Parameters
-
OperandNumber The operand number (1 to NumberOfOperands+1).
- Returns
◆ LoadMeritFunction()
| void ZOSAPI.Editors.MFE.IMeritFunctionEditor.LoadMeritFunction | ( | string | fileName | ) |
Replaces the entire MFE with the specified file contents.
- Parameters
-
fileName Name of the file.
◆ RemoveOperandAt()
| bool ZOSAPI.Editors.MFE.IMeritFunctionEditor.RemoveOperandAt | ( | int | OperandNumber | ) |
Removes the operand at the specified location.
- Parameters
-
OperandNumber The operand number (1 to NumberOfOperands).
- Returns
trueif the operand was successfully remove; otherwise,false.
◆ RemoveOperandsAt()
| int ZOSAPI.Editors.MFE.IMeritFunctionEditor.RemoveOperandsAt | ( | int | OperandNumber, |
| int | numOperands | ||
| ) |
Removes one or more operands at the specified location.
- Parameters
-
OperandNumber The first operand number to remove (1 to NumberOfOperands). numOperands The number operands to remove.
- Returns
- The number of operands actually removed.
◆ SaveMeritFunction()
| void ZOSAPI.Editors.MFE.IMeritFunctionEditor.SaveMeritFunction | ( | string | fileName | ) |
Saves the entire merit function to the specified file.
- Parameters
-
fileName Name of the file.
◆ ShowMFE()
| bool ZOSAPI.Editors.MFE.IMeritFunctionEditor.ShowMFE | ( | ) |
Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
- Returns
Property Documentation
◆ FirstColumn
|
get |
Gets the first available column.
The first column.
◆ LastColumn
|
get |
Gets the last available column.
The last column.
◆ MeritFunctionDirectory
|
get |
Gets the default merit function directory.
The merit function directory.
◆ NSCBitmapWizard
|
get |
Get the Mode-appropriate (Nonsequential/Sequential) Bitmap Wizard, Nonsequential ONLY.
- Returns
◆ NSCOptimizationWizard
|
get |
Get the Nonsequential Optimization Wizard.
- Returns
◆ NSCRoadwayLightingWizard
|
get |
Get the Mode-appropriate (Nonsequential/Sequential) Roadway Lighting Wizard, Nonsequential ONLY.
- Returns
◆ NumberOfOperands
|
get |
Gets the total number of operands in the current system.
The number of operands.
◆ RowToOperandOffset
|
get |
Offset from a row index to operand index (always 1).
The row to operand offset.
◆ SEQOptimizationWizard
|
get |
Get the Sequential Optimization Wizard; note that this wizard is obsolete and you should use SEQOptimizationWizard2 instead.
Usage (see Example 15 for a full sample)
C#
C++
Matlab
Python
- Returns
◆ SEQOptimizationWizard2
|
get |
Get the latest Sequential Optimization Wizard.
Public Member Functions inherited from