Skip to main content

ZOS-API interface 2024 R2 SP02

ZOSAPI.Editors.MCE.IMultiConfigEditor Interface Reference

Last update: 17.07.2025

This interface defines all properties and methods needed to interact with the Multiple Configuration Editor. This interface can be accessed via the IOpticalSystem interface. More...

Inheritance diagram for ZOSAPI.Editors.MCE.IMultiConfigEditor:

Public Member Functions

bool SetCurrentConfiguration (int ConfigurationNumber)
 Sets the currently active configuration for the system (1 to NumberOfConfigurations).
 
bool DeleteConfiguration (int ConfigurationNumber)
 Deletes the specified configuration (1 to NumberOfConfigurations).
 
bool DeleteAllConfigurations ()
 Deletes all but one configuration from the system.
 
bool InsertConfiguration (int ConfigurationNumber, bool withPickups)
 Inserts a new configuration at the specified index, optionally with pickups.
 
bool AddConfiguration (bool withPickups)
 Adds a new, last configuration.
 
void MakeSingleConfiguration ()
 Removes all configurations and operands. Note that this is the same as MakeSingleConfigurationOpt(bool) with an argument of false.
 
void MakeSingleConfigurationOpt (bool deleteMFEOperands)
 Removes all configurations and operands.
 
bool NextConfiguration ()
 Changes to the next configuration.
 
bool PrevConfiguration ()
 Changes to the previous configuration.
 
IMCERow GetOperandAt (int OperandNumber)
 Gets the specified operand data.
 
IMCERow InsertNewOperandAt (int OperandNumber)
 Inserts the a new operand at the specified location.
 
IMCERow AddOperand ()
 Adds a new operand to the end of the editor.
 
bool RemoveOperandAt (int OperandNumber)
 Removes the specified operand.
 
int RemoveOperandsAt (int OperandNumber, int numOperands)
 Removes one or more operands at the specified position.
 
bool ShowMCE ()
 Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
void HideMCE ()
 Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.
 
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 (IMultiConfigEditor 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.
 
void RunTool_MakeThermal (int existingConfigurationIndex, int numberOfThemalConfigs, double minTemp, double maxTemp, bool sortBySurface)
 
IMessage RunTool_MakeConjugate (int referenceConfig, int objectSurface, int stopSurface, int imageSurface)
 Runs the tool Make Conjugate to create a subset of the optical system which models imaging between any two conjugate surfaces as a new configuration.
 
IMessage RunTool_AddAllData (int numberOfConfig, bool sortBySurface, bool systemApertureData, bool fieldData, bool wavelengthData, bool surfaceData)
 Runs the tool Add All Data to add all data currently in the system to the MCE.
 
- 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.
 
int FirstConfiguration [get]
 Gets the first configuration number.
 
int LastConfiguration [get]
 Gets the last configuration number.
 
int NumberOfConfigurations [get]
 Gets the total number of configurations.
 
int CurrentConfiguration [get]
 Gets the current configuration number.
 
- 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 Multiple Configuration Editor. This interface can be accessed via the IOpticalSystem interface.

Examples
CSharpStandalone_18_SetMulticonfiguration.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

Member Function Documentation

◆ AddConfiguration()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.AddConfiguration ( bool  withPickups)

Adds a new, last configuration.

Usage (see Example 18 for a full sample)

C#

// Add two configurations (totally 3)
TheMCE.AddConfiguration(false);
TheMCE.AddConfiguration(false);

C++

// Add two configurations (totally 3)
TheMCE->AddConfiguration(false);
TheMCE->AddConfiguration(false);

Matlab

% Add 2 configurations (totally 3)
TheMCE.AddConfiguration(false);
TheMCE.AddConfiguration(false);

Python

# Add 2 configurations (totally 3)
TheMCE.AddConfiguration(False)
TheMCE.AddConfiguration(False)
Parameters
withPickupsif set to true add pickups from the previous configuration.
Returns
Examples
CSharpStandalone_18_SetMulticonfiguration.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

◆ AddOperand()

IMCERow ZOSAPI.Editors.MCE.IMultiConfigEditor.AddOperand ( )

Adds a new operand to the end of the editor.

Returns

Usage (see Example 18 for a full sample)

C#

// Add one operand (totally 2)
TheMCE.AddOperand();

C++

// Add one operand (totally 2)
TheMCE->AddOperand();

Matlab

% Add one operand (totally 2)
TheMCE.AddOperand();

Python

# Add one operand (totally 2)
TheMCE.AddOperand()
Examples
CSharpStandalone_18_SetMulticonfiguration.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

◆ CopyOperands()

int ZOSAPI.Editors.MCE.IMultiConfigEditor.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
fromOperandNumberFirst operand number to copy (1 to NumberOfOperands).
NumberOfOperandsThe number of operands to copy.
toOperandNumberRow to start inserting the operands (1 to NumberOfOperands+1).
Returns
The number of operands actually copied.

◆ CopyOperandsFrom()

int ZOSAPI.Editors.MCE.IMultiConfigEditor.CopyOperandsFrom ( IMultiConfigEditor  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
fromEditorSystem to copy the operands from. Note that the NumberOfConfigurations must the same as the current system.
fromOperandNumberFirst operand number to copy (1 to NumberOfOperands).
NumberOfOperandsThe number of operands to copy.
toOperandNumberTo operand number (1 to NumberOfOperands+1).
Returns
The number of operands actually copied.

◆ DeleteAllConfigurations()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.DeleteAllConfigurations ( )

Deletes all but one configuration from the system.

Returns

◆ DeleteConfiguration()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.DeleteConfiguration ( int  ConfigurationNumber)

Deletes the specified configuration (1 to NumberOfConfigurations).

Parameters
ConfigurationNumberThe configuration to delete.
Returns

◆ GetOperandAt()

IMCERow ZOSAPI.Editors.MCE.IMultiConfigEditor.GetOperandAt ( int  OperandNumber)

Gets the specified operand data.

Parameters
OperandNumberThe operand number (1 to NumberOfOperands).
Returns

Usage (see Example 18 for a full sample)

C#

// Get interface of each operand
IMCERow MCOperand1 = TheMCE.GetOperandAt(1);
IMCERow MCOperand2 = TheMCE.GetOperandAt(2);
// Change both operands' type to THIC
All data for a Multiple Configuration Editor operand. This interface can be accessed via the IMultiCo...
Definition: InterfacesMCE.cs:405
bool ChangeType(MultiConfigOperandType type)
Changes to the specified operand type.
MultiConfigOperandType
All supported Multi Configuration operand types.
Definition: InterfacesMCE.cs:30

C++

// Get interface of each operand
IMCERowPtr MCOperand1 = TheMCE->GetOperandAt(1);
IMCERowPtr MCOperand2 = TheMCE->GetOperandAt(2);
// Change both operands' type to THIC
MCOperand1->ChangeType(MultiConfigOperandType_THIC);
MCOperand2->ChangeType(MultiConfigOperandType_THIC);

Matlab

% Get interface of each operand
MCOperand1 = TheMCE.GetOperandAt(1);
MCOperand2 = TheMCE.GetOperandAt(2);
% Change both operands' type to THIC
MCOperand1.ChangeType(ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC);
MCOperand2.ChangeType(ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC);

Python

# Get interface of each operand
MCOperand1 = TheMCE.GetOperandAt(1)
MCOperand2 = TheMCE.GetOperandAt(2)
# Change both operands' type to THIC
MCOperand1.ChangeType(ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC)
MCOperand2.ChangeType(ZOSAPI.Editors.MCE.MultiConfigOperandType.THIC)
Examples
CSharpStandalone_18_SetMulticonfiguration.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

◆ HideMCE()

void ZOSAPI.Editors.MCE.IMultiConfigEditor.HideMCE ( )

Closes this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.

Returns

◆ InsertConfiguration()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.InsertConfiguration ( int  ConfigurationNumber,
bool  withPickups 
)

Inserts a new configuration at the specified index, optionally with pickups.

Parameters
ConfigurationNumberThe configuration number to insert at (1 to NumberOfConfigurations+1).
withPickupsIf set to true the next configuration will pickup values from the inserted configuration.
Returns

◆ InsertNewOperandAt()

IMCERow ZOSAPI.Editors.MCE.IMultiConfigEditor.InsertNewOperandAt ( int  OperandNumber)

Inserts the a new operand at the specified location.

Parameters
OperandNumberThe operand number (1 to NumberOfOperands+1).
Returns

◆ MakeSingleConfiguration()

void ZOSAPI.Editors.MCE.IMultiConfigEditor.MakeSingleConfiguration ( )

Removes all configurations and operands. Note that this is the same as MakeSingleConfigurationOpt(bool) with an argument of false.

◆ MakeSingleConfigurationOpt()

void ZOSAPI.Editors.MCE.IMultiConfigEditor.MakeSingleConfigurationOpt ( bool  deleteMFEOperands)

Removes all configurations and operands.

Parameters
deleteMFEOperandsif set to true merit function operands for delete configurations will be removed, else MFE operands will remain.

◆ NextConfiguration()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.NextConfiguration ( )

Changes to the next configuration.

Returns
true if there is another available configuration; otherwise, false.

◆ PrevConfiguration()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.PrevConfiguration ( )

Changes to the previous configuration.

Returns
true if there is another available configuration; otherwise, false.

◆ RemoveOperandAt()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.RemoveOperandAt ( int  OperandNumber)

Removes the specified operand.

Parameters
OperandNumberThe operand number (1 to NumberOfOperands).
Returns

◆ RemoveOperandsAt()

int ZOSAPI.Editors.MCE.IMultiConfigEditor.RemoveOperandsAt ( int  OperandNumber,
int  numOperands 
)

Removes one or more operands at the specified position.

Parameters
OperandNumberThe starting operand number (1 to NumberOfOperands).
numOperandsThe number of operands to remove.
Returns

◆ RunTool_AddAllData()

IMessage ZOSAPI.Editors.MCE.IMultiConfigEditor.RunTool_AddAllData ( int  numberOfConfig,
bool  sortBySurface,
bool  systemApertureData,
bool  fieldData,
bool  wavelengthData,
bool  surfaceData 
)

Runs the tool Add All Data to add all data currently in the system to the MCE.

Parameters
numberOfConfigThe number of configurations (1 to 160).
sortBySurfaceIf set to true, the data will be sorted by surface.
systemApertureDataIf set to true, the System Aperture Data will be included.
fieldDataIf set to true, the Field Data will be included.
wavelengthDataIf set to true, the WaveLength Data will be included.
surfaceDataIf set to true, the Surface Data will be included.
Returns
Error message if any occurs.

◆ RunTool_MakeConjugate()

IMessage ZOSAPI.Editors.MCE.IMultiConfigEditor.RunTool_MakeConjugate ( int  referenceConfig,
int  objectSurface,
int  stopSurface,
int  imageSurface 
)

Runs the tool Make Conjugate to create a subset of the optical system which models imaging between any two conjugate surfaces as a new configuration.

Parameters
referenceConfigThe configuration to be used (0 to NumberOfConfigurations+1)./>"/></param> <param name="objectSurface">The object surface from the list of all surfaces (0 to <see cref="OS.LDE.getListOfAllSurfaces().Count")./></param> <param name="stopSurface">The stop surface from the list of all surfaces (0 to <see cref="OS.LDE.getListOfAllSurfaces().Count")./></param> <param name="imageSurface">The image surface from the list of all surfaces (0 to <see cref="OS.LDE.getListOfAllSurfaces().Count")./>
Returns
Error message if any occurs.

◆ RunTool_MakeThermal()

void ZOSAPI.Editors.MCE.IMultiConfigEditor.RunTool_MakeThermal ( int  existingConfigurationIndex,
int  numberOfThemalConfigs,
double  minTemp,
double  maxTemp,
bool  sortBySurface 
)
Parameters
existingConfigurationIndex
numberOfThemalConfigs
minTemp
maxTemp
sortBySurface

◆ SetCurrentConfiguration()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.SetCurrentConfiguration ( int  ConfigurationNumber)

Sets the currently active configuration for the system (1 to NumberOfConfigurations).

Usage (see Example 18 for a full sample)

C#

// Refocus for each configuration
IQuickFocus quickfocus = TheSystem.Tools.OpenQuickFocus();
TheMCE.SetCurrentConfiguration(1);
quickfocus.RunAndWaitForCompletion();
TheMCE.SetCurrentConfiguration(2);
quickfocus.RunAndWaitForCompletion();
TheMCE.SetCurrentConfiguration(3);
quickfocus.RunAndWaitForCompletion();

C++

// Refocus for each configuration
IQuickFocusPtr quickfocus = TheSystem->Tools->OpenQuickFocus();
ISystemToolPtr baseTool = quickfocus;
TheMCE->SetCurrentConfiguration(1);
baseTool->RunAndWaitForCompletion();
TheMCE->SetCurrentConfiguration(2);
baseTool->RunAndWaitForCompletion();
TheMCE->SetCurrentConfiguration(3);
baseTool->RunAndWaitForCompletion();

Matlab

% Refocus for each configuration
quickfocus = TheSystem.Tools.OpenQuickFocus();
TheMCE.SetCurrentConfiguration(1); % Set system to config 1
quickfocus.RunAndWaitForCompletion(); % Quick focus for config 1
TheMCE.SetCurrentConfiguration(2);
quickfocus.RunAndWaitForCompletion();
TheMCE.SetCurrentConfiguration(3);
quickfocus.RunAndWaitForCompletion();

Python

# Refocus for each configuration
quickfocus = TheSystem.Tools.OpenQuickFocus()
TheMCE.SetCurrentConfiguration(1) # Set system to config 1
quickfocus.RunAndWaitForCompletion() # Quick focus for config 1
TheMCE.SetCurrentConfiguration(2)
quickfocus.RunAndWaitForCompletion()
TheMCE.SetCurrentConfiguration(3)
quickfocus.RunAndWaitForCompletion()
Parameters
ConfigurationNumberThe configuration number.
Returns
true if the configuration was successfully changed; otherwise, false.
Examples
CSharpStandalone_18_SetMulticonfiguration.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

◆ ShowMCE()

bool ZOSAPI.Editors.MCE.IMultiConfigEditor.ShowMCE ( )

Shows this editor in the UI. Note that this only has an effect if the IOpticalSystem.Mode is ZOSAPI_Mode.Plugin.

Returns

Property Documentation

◆ CurrentConfiguration

int ZOSAPI.Editors.MCE.IMultiConfigEditor.CurrentConfiguration
get

Gets the current configuration number.

The current configuration.

◆ FirstConfiguration

int ZOSAPI.Editors.MCE.IMultiConfigEditor.FirstConfiguration
get

Gets the first configuration number.

The first configuration.

◆ LastConfiguration

int ZOSAPI.Editors.MCE.IMultiConfigEditor.LastConfiguration
get

Gets the last configuration number.

The last configuration.

◆ NumberOfConfigurations

int ZOSAPI.Editors.MCE.IMultiConfigEditor.NumberOfConfigurations
get

Gets the total number of configurations.

The number of configurations.

Examples
CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

◆ NumberOfOperands

int ZOSAPI.Editors.MCE.IMultiConfigEditor.NumberOfOperands
get

Gets the total number of operands in the current system.

The number of operands.

◆ RowToOperandOffset

int ZOSAPI.Editors.MCE.IMultiConfigEditor.RowToOperandOffset
get

Offset from a row index to operand index (always 1).

The row to operand offset.

Connect with Ansys