ZOSAPI.Tools.General.IQuickFocus Interface Reference
Last update: 17.07.2025Interfaces and methods for running the Quick Focus tool. This interface can be accessed via the IOpticalSystemTools interface. More...
Inheritance diagram for ZOSAPI.Tools.General.IQuickFocus:

Properties | |
| bool | UseCentroid [get, set] |
| QuickFocusCriterion | Criterion [get, set] |
Properties inherited from ZOSAPI.Tools.ISystemTool | |
| int | Progress [get] |
| Gets the progress of the current tool, if supported. | |
| string | Status [get] |
| Gets the status of the current tool, if supporoted. | |
| bool | IsRunning [get] |
| Gets a value indicating whether the tool is currently running asynchronously. | |
| bool | CanCancel [get] |
| Gets a value indicating whether the tool can be cancelled. | |
| bool | IsAsynchronous [get] |
| Gets a value indicating whether the tool runs asynchronously (i.e. on a thread). | |
| bool | IsFiniteDuration [get] |
| Gets a value indicating whether this tool will complete on its own. | |
| bool | IsValid [get] |
| Gets a value indicating whether the input settings are valid. | |
| bool | Succeeded [get] |
| Gets a value indicating whether the tool execution succeeded. | |
| string | ErrorMessage [get] |
If Succeeded is false, get the error messages; otherwise, null. | |
Additional Inherited Members | |
Public Member Functions inherited from ZOSAPI.Tools.ISystemTool | |
| bool | Run () |
| Start the tool. Note that for synchronous tools (see IsAsynchronous), this call will block until completion. If it is asynchronous it will start running but return immediately. | |
| bool | RunAndWaitForCompletion () |
| Sames as calling Run followed by WaitForCompletion. | |
| bool | WaitForCompletion () |
| Waits for the asynchronous tool to complete. | |
| bool | Cancel () |
| Cancels the currently running asynchronous tool. | |
| bool | Close () |
| Closes this tool and frees up and associated resources. | |
| RunStatus | WaitWithTimeout (double timeOutSeconds) |
| Waits for the currently running tool to complete, with a specified time out value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. Also note that this method will not start the tool running if it is not already. | |
| RunStatus | RunAndWaitWithTimeout (double timeOutSeconds) |
| Starts the tool running, and waits for it to complete with the specified timeout value. Note that if the timeout is exceeded this method will return, however the tool will continue to run. | |
Detailed Description
Interfaces and methods for running the Quick Focus tool. This interface can be accessed via the IOpticalSystemTools interface.
Usage (see Example 15 for a full sample)
C#
//change BFL & run quick focus
Surface_Last.Thickness = 40.0;
IQuickFocus QFocus = tools.OpenQuickFocus();
QFocus.Criterion = QuickFocusCriterion.SpotSizeRadial;
QFocus.UseCentroid = true;
QFocus.RunAndWaitForCompletion();
QFocus.Close();
SampleFile = System.IO.Path.Combine(TheApplication.SamplesDir, @"API\CS\e15_Seq_Optimization\OptimizedFile2.zos");
TheSystem.SaveAs(SampleFile);
Interfaces and methods for running the Quick Focus tool. This interface can be accessed via the IOpti...
Definition: Tools.cs:793
bool RunAndWaitForCompletion()
Sames as calling Run followed by WaitForCompletion.
C++
// change BFL & run quick focus
Surface_Last->Thickness = 40.0;
IQuickFocusPtr QFocus = tools->OpenQuickFocus();
QFocus->Criterion = QuickFocusCriterion::QuickFocusCriterion_SpotSizeRadial;
QFocus->UseCentroid = true;
ISystemToolPtr baseTool = QFocus;
baseTool->RunAndWaitForCompletion();
baseTool->Close();
SampleFile = _bstr_t(TheApplication->SamplesDir) + "\\API\\CPP\\e15_Seq_Optimization\\OptimizedFile2.zos";
TheSystem->SaveAs(SampleFile);
Matlab
%change BFL & run quick focus
Surface_Last.Thickness = 40.0;
QFocus = tools.OpenQuickFocus();
QFocus.UseCentroid = true;
QFocus.RunAndWaitForCompletion();
QFocus.Close();
SampleFile = System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e15_Seq_Optimization\OptimizedFile2.zos');
TheSystem.SaveAs(SampleFile);
Definition: Tools.cs:697
Definition: FileSource.cs:4
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5
Python
# change BFL & run quick focus
Surface_Last.Thickness = 40.0
QFocus = tools.OpenQuickFocus()
QFocus.Criterion = ZOSAPI.Tools.General.QuickAdjustCriterion.SpotSizeRadial
QFocus.UseCentroid = True
QFocus.RunAndWaitForCompletion()
QFocus.Close()
SampleFile = TheApplication.SamplesDir + '\\API\\Python\\e15_Seq_Optimization\\OptimizedFile2.zos'
TheSystem.SaveAs(SampleFile)
Property Documentation
◆ Criterion
|
getset |
Usage (see Example 01 for a full sample)
C#
// QuickFocus
IQuickFocus quickFocus = TheSystem.Tools.OpenQuickFocus();
quickFocus.Criterion = QuickFocusCriterion.SpotSizeRadial;
quickFocus.UseCentroid = true;
quickFocus.RunAndWaitForCompletion();
quickFocus.Close();
C++
// QuickFocus
IQuickFocusPtr quickFocus = TheSystem->Tools->OpenQuickFocus();
quickFocus->Criterion = QuickFocusCriterion_SpotSizeRadial;
quickFocus->UseCentroid = true;
ISystemToolPtr baseTool = quickFocus;
baseTool->RunAndWaitForCompletion();
baseTool->Close();
Matlab
% QuickFocus
quickFocus = TheSystem.Tools.OpenQuickFocus();
quickFocus.UseCentroid = true;
quickFocus.RunAndWaitForCompletion();
quickFocus.Close();
Python
# QuickFocus
quickFocus = TheSystem.Tools.OpenQuickFocus()
quickFocus.Criterion = ZOSAPI.Tools.General.QuickFocusCriterion.SpotSizeRadial
quickFocus.UseCentroid = True
quickFocus.RunAndWaitForCompletion()
quickFocus.Close()
◆ UseCentroid
|
getset |
Properties inherited from