Interface ZOSAPI::Analysis::Settings::IAS_
Last update: 13.03.2026
Definition:
Base class for all analysis settings interfaces. This class can be accessed via the IA_ interface.
Usage (see Example 15 for a full sample)
C#
//Open a shaded model
IA_ analysis = TheSystem.Analyses.New_Analysis(AnalysisIDM.ShadedModel);
analysis.Terminate();
analysis.WaitForCompletion();
IAS_ analysisSettings = analysis.GetSettings();
string cfgFile = System.IO.Path.GetTempFileName();
// Save the current settings to the temp file
analysisSettings.SaveTo(cfgFile);
// make your modifications to it
//MODIFYSETTINGS are defined in the ZPL help files: The Programming Tab > About the ZPL > Keywords
analysisSettings.ModifySettings(cfgFile, "SHA_ROTX", "90");
analysisSettings.ModifySettings(cfgFile, "SHA_ROTY", "0");
analysisSettings.ModifySettings(cfgFile, "SHA_ROTZ", "0");
// now load in the modified settings
analysisSettings.LoadFrom(cfgFile);
// If you want to overwrite your default CFG, copy it after you are done modifying the settings:
//string CFG_fullname = System.Environment.GetEnvironmentVariable("USERPROFILE") + "\\Documents\\Zemax\\Configs\\Configs\\POP.CFG";
//System.IO.File.Copy(cfgFile, CFG_fullname, true);
// We don't need the temp file any more, so delete it
System.IO.File.Delete(cfgFile);
// Run the analysis with the new settings
analysis.ApplyAndWaitForCompletion();
C++
// Open a shaded model
IA_Ptr analysis = TheSystem->Analyses->New_Analysis(AnalysisIDM::AnalysisIDM_ShadedModel);
analysis->Terminate();
analysis->WaitForCompletion();
IAS_Ptr settings = analysis->GetSettings();
//need to use - #pragma warning(disable:4996)
char* pUserprofile = getenv("Temp");
_bstr_t cfgFile = _bstr_t(pUserprofile) + "\\sha.cfg";
// Save the current settings to the temp file
settings->SaveTo(cfgFile);
// make your modifications to it
// MODIFYSETTINGS are defined in the ZPL help files : The Programming Tab > About the ZPL > Keywords
settings->ModifySettings(cfgFile, "SHA_ROTX", "90");
settings->ModifySettings(cfgFile, "SHA_ROTY", "0");
settings->ModifySettings(cfgFile, "SHA_ROTZ", "0");
// now load in the modified settings
settings->LoadFrom(cfgFile);
// If you want to overwrite your default CFG, copy it after you are done modifying the settings :
//_bstr_t CFG_fullname = _bstr_t(getenv("USERPROFILE")) + "\\Documents\\Zemax\\Configs\\POP.CFG";
// copyfile(cfgFile, CFG_fullname) // generic psuedo code
// We don't need the temp file any more, so delete it
std::remove(cfgFile);
// Run the analysis with the new settings
analysis->ApplyAndWaitForCompletion();
Matlab
%Open a shaded model
analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.ShadedModel);
analysis.Terminate();
analysis.WaitForCompletion();
analysisSettings = analysis.GetSettings();
cfgFile = System.IO.Path.GetTempFileName();
% Save the current settings to the temp file
analysisSettings.SaveTo(cfgFile);
% make your modifications to it
%MODIFYSETTINGS are defined in the ZPL help files: The Programming Tab > About the ZPL > Keywords
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTX', '90');
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTY', '0');
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTZ', '0');
% now load in the modified settings
analysisSettings.LoadFrom(cfgFile);
% If you want to overwrite your default CFG, copy it after you are done modifying the settings:
%string CFG_fullname = System.Environment.GetEnvironmentVariable("USERPROFILE") + "\\Configs\\POP.CFG";
%System.IO.File.Copy(cfgFile, CFG_fullname, true);
% We don't need the temp file any more, so delete it
System.IO.File.Delete(cfgFile);
% Run the analysis with the new settings
analysis.ApplyAndWaitForCompletion();
Python
# Open a shaded model
analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.ShadedModel)
analysis.Terminate()
analysis.WaitForCompletion()
analysisSettings = analysis.GetSettings()
cfgFile = os.environ.get('Temp') + '\\sha.cfg'
# Save the current settings to the temp file
analysisSettings.SaveTo(cfgFile)
# make your modifications to it
# MODIFYSETTINGS are defined in the ZPL help files: The Programming Tab > About the ZPL > Keywords
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTX', '90')
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTY', '0')
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTZ', '0')
# now load in the modified settings
analysisSettings.LoadFrom(cfgFile)
# If you want to overwrite your default CFG, copy it after you are done modifying the settings:
# CFG_fullname = os.environ.get('USERPROFILE') + '\\Documents\\Zemax\\Configs\\POP.CFG'
# copyfile(cfgFile, CFG_fullname)
# We don't need the temp file any more, so delete it
if os.path.exists(cfgFile):
os.remove(cfgFile)
# Run the analysis with the new settings
analysis.ApplyAndWaitForCompletion()
Inherited by:
- ZOSAPI.Analysis.PhysicalOptics.IAS_PhysicalOpticsPropagation
- ZOSAPI.Analysis.RayTracing.IAS_PathAnalysis
- ZOSAPI.Analysis.Settings.Aberrations.IAS_FieldCurvatureAndDistortion
- ZOSAPI.Analysis.Settings.Aberrations.IAS_FocalShiftDiagram
- ZOSAPI.Analysis.Settings.Aberrations.IAS_FullFieldAberration
- ZOSAPI.Analysis.Settings.Aberrations.IAS_GridDistortion
- ZOSAPI.Analysis.Settings.Aberrations.IAS_LateralColor
- ZOSAPI.Analysis.Settings.Aberrations.IAS_LongitudinalAberration
- ZOSAPI.Analysis.Settings.Aberrations.IAS_RayTrace
- ZOSAPI.Analysis.Settings.Aberrations.IAS_SeidelCoefficients
- ZOSAPI.Analysis.Settings.Aberrations.IAS_SeidelDiagram
- ZOSAPI.Analysis.Settings.Aberrations.IAS_ZernikeAnnularCoefficients
- ZOSAPI.Analysis.Settings.Aberrations.IAS_ZernikeCoefficientsVsField
- ZOSAPI.Analysis.Settings.Aberrations.IAS_ZernikeFringeCoefficients
- ZOSAPI.Analysis.Settings.Aberrations.IAS_ZernikeStandardCoefficients
- ZOSAPI.Analysis.Settings.Coatings.IAS_RTA_Angle
- ZOSAPI.Analysis.Settings.Coatings.IAS_RTA_Wavelength
- ZOSAPI.Analysis.Settings.DiffractionEfficiency.IAS_DiffEfficiency2D
- ZOSAPI.Analysis.Settings.DiffractionEfficiency.IAS_DiffEfficiencyAngular
- ZOSAPI.Analysis.Settings.DiffractionEfficiency.IAS_DiffEfficiencyChromatic
- ZOSAPI.Analysis.Settings.EncircledEnergy.IAS_DiffractionEncircledEnergy
- ZOSAPI.Analysis.Settings.EncircledEnergy.IAS_ExtendedSourceEncircledEnergy
- ZOSAPI.Analysis.Settings.EncircledEnergy.IAS_GeometricEncircledEnergy
- ZOSAPI.Analysis.Settings.EncircledEnergy.IAS_GeometricLineEdgeSpread
- ZOSAPI.Analysis.Settings.ExtendedScene.IAS_GeometricImageAnalysis
- ZOSAPI.Analysis.Settings.ExtendedScene.IAS_ImageSimulation
- ZOSAPI.Analysis.Settings.ExtendedScene.IAS_RelativeIllumination
- ZOSAPI.Analysis.Settings.Fans.IAS_Fan
- ZOSAPI.Analysis.Settings.IAS_CriticalRayTracer
- ZOSAPI.Analysis.Settings.IAS_FileComparator
- ZOSAPI.Analysis.Settings.IAS_Interferogram
- ZOSAPI.Analysis.Settings.IAS_WavefrontMap
- ZOSAPI.Analysis.Settings.IAS_XXXTemplateXXX
- ZOSAPI.Analysis.Settings.Materials.IAS_GrinProfile
- ZOSAPI.Analysis.Settings.Materials.IAS_InternalTransmissionvsWavelength
- ZOSAPI.Analysis.Settings.Mtf.IAS_ContrastLossMap
- ZOSAPI.Analysis.Settings.Mtf.IAS_FftMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_FftMtfMap
- ZOSAPI.Analysis.Settings.Mtf.IAS_FftMtfvsField
- ZOSAPI.Analysis.Settings.Mtf.IAS_FftSurfaceMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_FftThroughFocusMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_GeometricMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_GeometricMtfMap
- ZOSAPI.Analysis.Settings.Mtf.IAS_GeometricMtfvsField
- ZOSAPI.Analysis.Settings.Mtf.IAS_GeometricThroughFocusMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_HuygensMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_HuygensMtfvsField
- ZOSAPI.Analysis.Settings.Mtf.IAS_HuygensSurfaceMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_HuygensThroughFocusMtf
- ZOSAPI.Analysis.Settings.Mtf.IAS_NSCGeometricMtf
- ZOSAPI.Analysis.Settings.NSCSpot.IAS_NSCSpot
- ZOSAPI.Analysis.Settings.NSCSurface.IAS_NSCSurfaceSag
- ZOSAPI.Analysis.Settings.Psf.IAS_FftPsf
- ZOSAPI.Analysis.Settings.Psf.IAS_FftPsfCrossSection
- ZOSAPI.Analysis.Settings.Psf.IAS_FftPsfLineEdgeSpread
- ZOSAPI.Analysis.Settings.Psf.IAS_HuygensPsf
- ZOSAPI.Analysis.Settings.Psf.IAS_HuygensPsfCrossSection
- ZOSAPI.Analysis.Settings.RMS.IAS_RMSField
- ZOSAPI.Analysis.Settings.RMS.IAS_RMSFieldMap
- ZOSAPI.Analysis.Settings.RMS.IAS_RMSFocus
- ZOSAPI.Analysis.Settings.RMS.IAS_RMSLambdaDiagram
- ZOSAPI.Analysis.Settings.RayTracing.IAS_DetectorViewer
- ZOSAPI.Analysis.Settings.RayTracing.IAS_NSCSingleRayTrace
- ZOSAPI.Analysis.Settings.Spot.IAS_Spot
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfaceCurvature
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfaceCurvatureCross
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfacePhase
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfacePhaseCross
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfacePhaseSlope
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfacePhaseSlopeCross
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfaceSag
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfaceSagCross
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfaceSlope
- ZOSAPI.Analysis.Settings.Surface.IAS_SurfaceSlopeCross
- ZOSAPI.Analysis.Settings.Wavefront.IAS_Foucault
- ZOSAPI.Analysis.Tolerancing.IAS_ISOElementDrawing
- ZOSAPI.Analysis.Tolerancing.IAS_QuickYield
- ZOSAPI.Analysis.Tolerancing.IAS_TolerancingHistogram
- ZOSAPI.Analysis.Tolerancing.IAS_TolerancingYield
Members
Public functions
Function Verify
IMessages ZOSAPI.Analysis.Settings.IAS_.Verify()
Return type: IMessages
Function Save
void ZOSAPI.Analysis.Settings.IAS_.Save()
Saves the current settings to the default CFG file.
Return type: void
Function Load
void ZOSAPI.Analysis.Settings.IAS_.Load()
Loads settings from the default CFG file.
Return type: void
Function Reset
void ZOSAPI.Analysis.Settings.IAS_.Reset()
Resets the settings back to the defaults for the current analysis.
Return type: void
Reimplemented by:
Function SaveTo
bool ZOSAPI.Analysis.Settings.IAS_.SaveTo(string settingsFile)
Saves the current settings to the specified file.
Usage (see Example 17 for a full sample)
C#
//Open a detector viewer
analysis = TheSystem.Analyses.New_Analysis(AnalysisIDM.DetectorViewer);
analysisSettings = analysis.GetSettings();
cfgFile = System.IO.Path.GetTempFileName();
analysisSettings.SaveTo(cfgFile);
analysisSettings.ModifySettings(cfgFile, "DVW_SHOW", "2");
analysisSettings.ModifySettings(cfgFile, "DVW_SMOOTHING", "1");
analysisSettings.LoadFrom(cfgFile);
System.IO.File.Delete(cfgFile);
analysis.ApplyAndWaitForCompletion();
C++
//Open a detector viewer
analysis = TheSystem->Analyses->New_Analysis(AnalysisIDM_DetectorViewer);
analysisSettings = analysis->GetSettings();
tmpnam_s(cfgFile, L_tmpnam_s);
analysisSettings->SaveTo(cfgFile);
analysisSettings->ModifySettings(cfgFile, "DVW_SHOW", "2");
analysisSettings->ModifySettings(cfgFile, "DVW_SMOOTHING", "1");
analysisSettings->LoadFrom(cfgFile);
remove(cfgFile);
analysis->ApplyAndWaitForCompletion();
Matlab
% Open a detector viewer
det_analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.DetectorViewer);
det_analysisSettings = det_analysis.GetSettings();
det_cfgFile = System.String.Concat(SamplesFolder, '\API\Matlab\e17_DetectorViewer.cfg');
det_analysisSettings.SaveTo(det_cfgFile);
det_analysisSettings.ModifySettings(det_cfgFile, 'DVW_SHOW', '2');
det_analysisSettings.ModifySettings(det_cfgFile, 'DVW_SMOOTHING', '1');
det_analysisSettings.LoadFrom(det_cfgFile);
det_analysis.ApplyAndWaitForCompletion();
Python
# Open a detector viewer
det_analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.DetectorViewer)
det_analysisSettings = det_analysis.GetSettings()
det_cfgFile = SamplesFolder + "\\API\\Python\\e17_DetectorViewer.cfg"
det_analysisSettings.SaveTo(det_cfgFile)
det_analysisSettings.ModifySettings(det_cfgFile, "DVW_SHOW", "2")
det_analysisSettings.ModifySettings(det_cfgFile, "DVW_SMOOTHING", "1")
det_analysisSettings.LoadFrom(det_cfgFile)
det_analysis.ApplyAndWaitForCompletion()
Parameters:
- settingsFile: The settings file.
Returns:
Parameters:
- string settingsFile
Return type: bool
Function LoadFrom
bool ZOSAPI.Analysis.Settings.IAS_.LoadFrom(string settingsFile)
Replaces the current settings with settings read from the specified file.
Usage (see Example 17 for a full sample)
C#
//Open a detector viewer
analysis = TheSystem.Analyses.New_Analysis(AnalysisIDM.DetectorViewer);
analysisSettings = analysis.GetSettings();
cfgFile = System.IO.Path.GetTempFileName();
analysisSettings.SaveTo(cfgFile);
analysisSettings.ModifySettings(cfgFile, "DVW_SHOW", "2");
analysisSettings.ModifySettings(cfgFile, "DVW_SMOOTHING", "1");
analysisSettings.LoadFrom(cfgFile);
System.IO.File.Delete(cfgFile);
analysis.ApplyAndWaitForCompletion();
C++
//Open a detector viewer
analysis = TheSystem->Analyses->New_Analysis(AnalysisIDM_DetectorViewer);
analysisSettings = analysis->GetSettings();
tmpnam_s(cfgFile, L_tmpnam_s);
analysisSettings->SaveTo(cfgFile);
analysisSettings->ModifySettings(cfgFile, "DVW_SHOW", "2");
analysisSettings->ModifySettings(cfgFile, "DVW_SMOOTHING", "1");
analysisSettings->LoadFrom(cfgFile);
remove(cfgFile);
analysis->ApplyAndWaitForCompletion();
Matlab
% Open a detector viewer
det_analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.DetectorViewer);
det_analysisSettings = det_analysis.GetSettings();
det_cfgFile = System.String.Concat(SamplesFolder, '\API\Matlab\e17_DetectorViewer.cfg');
det_analysisSettings.SaveTo(det_cfgFile);
det_analysisSettings.ModifySettings(det_cfgFile, 'DVW_SHOW', '2');
det_analysisSettings.ModifySettings(det_cfgFile, 'DVW_SMOOTHING', '1');
det_analysisSettings.LoadFrom(det_cfgFile);
det_analysis.ApplyAndWaitForCompletion();
Python
# Open a detector viewer
det_analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.DetectorViewer)
det_analysisSettings = det_analysis.GetSettings()
det_cfgFile = SamplesFolder + "\\API\\Python\\e17_DetectorViewer.cfg"
det_analysisSettings.SaveTo(det_cfgFile)
det_analysisSettings.ModifySettings(det_cfgFile, "DVW_SHOW", "2")
det_analysisSettings.ModifySettings(det_cfgFile, "DVW_SMOOTHING", "1")
det_analysisSettings.LoadFrom(det_cfgFile)
det_analysis.ApplyAndWaitForCompletion()
Parameters:
- settingsFile: The settings file.
Returns:
Parameters:
- string settingsFile
Return type: bool
Function ModifySettings
bool ZOSAPI.Analysis.Settings.IAS_.ModifySettings(string settingsFile, string typeCode, string newValue)
Changes a single setting in the specified file. See the MODIFYSETTINGS DDE command help documentation for more information.
Usage (see Example 17 for a full sample)
C#
//Open a shaded model
IA_ analysis = TheSystem.Analyses.New_Analysis(AnalysisIDM.NSCShadedModel);
analysis.Terminate();
analysis.WaitForCompletion();
IAS_ analysisSettings = analysis.GetSettings();
string cfgFile = System.IO.Path.GetTempFileName();
// Save the current settings to the temp file
analysisSettings.SaveTo(cfgFile);
// make your modifications to it
//MODIFYSETTINGS are defined in the ZPL help files: The Programming Tab > About the ZPL > Keywords
analysisSettings.ModifySettings(cfgFile, "SHA_ROTX", "20");
analysisSettings.ModifySettings(cfgFile, "SHA_ROTY", "-20");
analysisSettings.ModifySettings(cfgFile, "SHA_ROTZ", "30");
// now load in the modified settings
analysisSettings.LoadFrom(cfgFile);
// If you want to overwrite your default CFG, copy it after you are done modifying the settings:
//string CFG_fullname = "\\zmedc02\\users\\sandrine.auriol\\Documents\\Zemax\\Configs\\POP.CFG";
//System.IO.File.Copy(cfgFile, CFG_fullname, true);
// We don't need the temp file any more, so delete it
System.IO.File.Delete(cfgFile);
// Run the analysis with the new settings
analysis.ApplyAndWaitForCompletion();
C++
//Open a shaded model
IA_Ptr analysis = TheSystem->Analyses->New_Analysis(AnalysisIDM_NSCShadedModel);
analysis->Terminate();
analysis->WaitForCompletion();
IAS_Ptr analysisSettings = analysis->GetSettings();
char cfgFile[L_tmpnam_s];
tmpnam_s(cfgFile, L_tmpnam_s);
// Save the current settings to the temp file
analysisSettings->SaveTo(cfgFile);
// make your modifications to it
// MODIFYSETTINGS are defined in the ZPL help files: The Programming Tab > About the ZPL > Keywords
analysisSettings->ModifySettings(cfgFile, "SHA_ROTX", "20");
analysisSettings->ModifySettings(cfgFile, "SHA_ROTY", "-20");
analysisSettings->ModifySettings(cfgFile, "SHA_ROTZ", "30");
// now load in the modified settings
analysisSettings->LoadFrom(cfgFile);
// We don't need the temp file any more, so delete it
remove(cfgFile);
// Run the analysis with the new settings
analysis->ApplyAndWaitForCompletion();
Matlab
% Open a shaded model
analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.NSCShadedModel);
analysis.WaitForCompletion();
analysisSettings = analysis.GetSettings();
cfgFile = char(System.String.Concat(SamplesFolder, '\API\Matlab\e17_NSC_BulkScatter.cfg'));
analysisSettings.SaveTo(cfgFile); % Save current settings to a cfg file
% MODIFYSETTINGS are defined in ZPL help files: The Programming Tab > About the ZPL > Keywords
% need to manually turn on SCATTERING in shaded model to see bulk scattering
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTX', '20');
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTY', '-20');
analysisSettings.ModifySettings(cfgFile, 'SHA_ROTZ', '30');
analysisSettings.LoadFrom(cfgFile); % Load in the newly modified settings
% If you want to overwrite your default CFG, save over it with newly modified CFG file:
% CFG_fullname = System.String.Concat(getenv('Temp'), '\Documents\Zemax\Configs\LSN.CFG');
% copyfile(char(cfgFile), char(CFG_fullname));
analysis.ApplyAndWaitForCompletion(); % Run analysis
Python
# Open a shaded model
analysis = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.NSCShadedModel)
analysis.WaitForCompletion()
analysisSettings = analysis.GetSettings()
cfgFile = SamplesFolder + "\\API\\Python\\e17_NSC_BulkScatter.cfg"
analysisSettings.SaveTo(cfgFile) # Save current settings to a cfg file
# MODIFYSETTINGS are defined in ZPL help files: The Programming Tab > About the ZPL > Keywords
analysisSettings.ModifySettings(cfgFile, "SHA_ROTX", "20")
analysisSettings.ModifySettings(cfgFile, "SHA_ROTY", "-20")
analysisSettings.ModifySettings(cfgFile, "SHA_ROTZ", "30")
analysisSettings.LoadFrom(cfgFile) # Load in the newly modified settings
# If you want to overwrite your default CFG, save over it with newly modified CFG file:
# CFG_fullname = "C:\\Users\\zachary.Derocher\\Documents\\Zemax\\Configs\\POP.CFG"
# import shutil
# shutil.copy(cfgFile, CFG_fullname)
analysis.ApplyAndWaitForCompletion() # Run analysis
Parameters:
- settingsFile: The settings file.
- typeCode: The type code.
- newValue: The new value.
Returns:
Parameters:
- string settingsFile
- string typeCode
- string newValue
Return type: bool