Skip to main content

ZOS-API interface 2024 R1

ZOSAPI.Tools Namespace Reference

Last update: 17.07.2025

Namespaces

namespace  FileManager
 
namespace  General
 
namespace  Layouts
 
namespace  Optimization
 
namespace  OptimizationTools
 
namespace  RayTrace
 
namespace  Tolerancing
 

Classes

interface  IAPIUtilities
 
interface  IConvertToNSCGroup
 Interfaces and methods for converting the sequential surfaces to a non-sequential group. This interface can be accessed via the IOpticalSystemTools interface. More...
 
interface  ICriticalRaysetGenerator
 Interfaces and methods for generating a 'critical rayset'; these rays can be used after converting to non-sequential in order to verify that the conversion did not fundamentally alter the geometries. This interface can be accessed via the IOpticalSystemTools interface. More...
 
interface  IDesignLockdown
 Interfaces and methods for validating a sequential design, prior to manufacturing or conversion to non-sequential. This interface can be accessed via the IOpticalSystemTools interface. More...
 
interface  IExportToSpeosLensSystem
 Interface to access the "Export to Speos Lens System" tool. This interface can be accessed via the IOpticalSystemTools interface. More...
 
interface  IExportToSpeosWhitebox
 
interface  IFileManager
 
interface  IHPCSettings
 
interface  IInternalBirefringenceData
 
interface  IInternalBirefringenceParameter
 
interface  IInternalTransmissionData
 
interface  IInternalTransmissionParameter
 
interface  ILayouts
 
interface  IMaterialsCatalog
 
interface  IMFCalculator
 Interfaces and methods for calculating the current Merit Function value. This interface can be accessed via the IOpticalSystemTools interface. More...
 
interface  IOpticalSystemTools
 Methods to run various system-wide tools. This interface can be accessed via the IOpticalSystem interface. Note that only one ISystemTool can be open at a time; the previous tool must be closed using ISystemTool.Close before a new one can be opened. More...
 
interface  IShadedModelTriangleList
 
interface  IShadedModelVisualizationExport
 Interfaces and methods for getting a set of triangles for selected parts of the system. This interface can be accessed via the IOpticalSystemTools interface. More...
 
interface  ISystemTool
 Base interface for all system tools. See IOpticalSystemTools for access to specific tools. More...
 

Enumerations

enum  RayPatternOption {
  XyFan = 0 , XFan = 1 , YFan = 2 , ChiefAndRing = 3 ,
  List = 4 , Grid = 6 , ChiefAndMarginals = 8
}
 
enum  CriticalRayType {
  Chief = 0 , Marginal = 1 , Grid = 2 , Ring = 3 ,
  Y_Fan = 4 , X_Fan = 5 , XY_Fan = 6 , List = 7
}
 
enum  MaterialFormulas {
  Schott = 1 , Sellmeier1 = 2 , Herzberger = 3 , Sellmeier2 = 4 ,
  Conrady = 5 , Sellmeier3 = 6 , Handbook1 = 7 , Handbook2 = 8 ,
  Sellmeier4 = 9 , Extended = 10 , Sellmeier5 = 11 , Extended2 = 12 ,
  Extended3 = 13
}
 
enum  MaterialStatuses {
  Standard = 0 , Preferred = 1 , Obsolete = 2 , Special = 3 ,
  Melt = 4
}
 
enum  VertexOrder { First , Second , Third }
 
enum  HPCEnvironments { OnPremise = 0 , AWSKubernetes , AzureKubernetes }
 
enum  HPCNodeSize {
  Default = 0 , Tiny = 1 , Small = 2 , Medium = 3 ,
  Large = 4 , XLarge = 5
}
 
enum  HPCRunState {
  NotRunning = 0 , Initializing , ClusterAllocating , UploadingData ,
  Queued , RunStarting , WaitingForResults , Complete
}
 
enum  RunStatus { Completed , FailedToStart , TimedOut , InvalidTimeout }
 

Detailed Description

Usage (see Example 15 for a full sample)

C#

// remove all variables and add a F# solve on last surface radius
ILensDataEditor TheLDE = TheSystem.LDE;
IOpticalSystemTools tools = TheSystem.Tools;
ILDERow Surface_Last = TheLDE.GetSurfaceAt(TheLDE.NumberOfSurfaces - 2);
ISolveData Solver = Surface_Last.RadiusCell.CreateSolveType(ZOSAPI.Editors.SolveType.FNumber);
Solver._S_FNumber.FNumber = 3.1415;
Surface_Last.RadiusCell.SetSolveData(Solver);
SampleFile = System.IO.Path.Combine(TheApplication.SamplesDir, @"API\CS\e15_Seq_Optimization\OptimizedFile1.zos");
TheSystem.SaveAs(SampleFile);
Methods to run various system-wide tools. This interface can be accessed via the IOpticalSystem inter...
Definition: Tools.cs:107
bool RemoveAllVariables()
Removes all variables in the system.
Definition: InterfacesEditors.cs:12
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

// remove all variables and add a F# solve on last surface radius
ILensDataEditorPtr TheLDE = TheSystem->LDE;
//IOpticalSystemTools
IOpticalSystemToolsPtr tools = TheSystem->Tools;
tools->RemoveAllVariables();
ILDERowPtr Surface_Last = TheLDE->GetSurfaceAt(TheLDE->NumberOfSurfaces - 2);
ISolveDataPtr Solver = Surface_Last->RadiusCell->CreateSolveType(SolveType::SolveType_FNumber);
Solver->_S_FNumber->FNumber = 3.1415;
Surface_Last->RadiusCell->SetSolveData(Solver);
SampleFile = _bstr_t(TheApplication->SamplesDir) + "\\API\\\Seq_Optimization\\\OptimizedFile1.zos";
TheSystem->SaveAs(SampleFile);

Matlab

% remove all variables and add a F# solve on last surface radius
TheLDE = TheSystem.LDE;
tools = TheSystem.Tools;
tools.RemoveAllVariables();
Surface_Last = TheLDE.GetSurfaceAt(TheLDE.NumberOfSurfaces - 2);
Solver = Surface_Last.RadiusCell.CreateSolveType(ZOSAPI.Editors.SolveType.FNumber);
Solver.S_FNumber_.FNumber = 3.1415;
Surface_Last.RadiusCell.SetSolveData(Solver);
SampleFile = System.String.Concat(TheApplication.SamplesDir, '\API\Matlab\e15_Seq_Optimization\OptimizedFile1.zos');
TheSystem.SaveAs(SampleFile);

Python

# remove all variables and add a F# solve on last surface radius
TheLDE = TheSystem.LDE
#IOpticalSystemTools
tools = TheSystem.Tools
tools.RemoveAllVariables()
Surface_Last = TheLDE.GetSurfaceAt(TheLDE.NumberOfSurfaces - 2)
Solver = Surface_Last.RadiusCell.CreateSolveType(ZOSAPI.Editors.SolveType.FNumber)
Solver._S_FNumber.FNumber = 3.1415
Surface_Last.RadiusCell.SetSolveData(Solver)
SampleFile = TheApplication.SamplesDir + '\\API\\Python\\e15_Seq_Optimization\\OptimizedFile1.zos'
TheSystem.SaveAs(SampleFile)

Enumeration Type Documentation

◆ CriticalRayType

Enumerator
Chief 
Marginal 
Grid 
Ring 
Y_Fan 
X_Fan 
XY_Fan 
List 

◆ HPCEnvironments

Enumerator
OnPremise 
AWSKubernetes 
AzureKubernetes 

◆ HPCNodeSize

Enumerator
Default 
Tiny 
Small 
Medium 
Large 
XLarge 

◆ HPCRunState

Enumerator
NotRunning 
Initializing 
ClusterAllocating 
UploadingData 
Queued 
RunStarting 
WaitingForResults 
Complete 

◆ MaterialFormulas

Enumerator
Schott 
Sellmeier1 
Herzberger 
Sellmeier2 
Conrady 
Sellmeier3 
Handbook1 
Handbook2 
Sellmeier4 
Extended 
Sellmeier5 
Extended2 
Extended3 

◆ MaterialStatuses

Enumerator
Standard 
Preferred 
Obsolete 
Special 
Melt 

◆ RayPatternOption

Enumerator
XyFan 
XFan 
YFan 
ChiefAndRing 
List 
Grid 
ChiefAndMarginals 

◆ RunStatus

Enumerator
Completed 

The tool completed running.

FailedToStart 

The tool either failed to start, or a wait was requested on a tool that was not already running.

TimedOut 

The time out value was exceeded; note that the tool will continue running.

InvalidTimeout 

An invalid timeout value was specified.

◆ VertexOrder

Enumerator
First 
Second 
Third 

Connect with Ansys