Skip to main content

ZOS-API interface 2025 R1

ZOSAPI.Tools.FileManager.IConvertProjectToFileTool Interface Reference

Last update: 17.07.2025

Tool for converting a Lens Project to a Lens File. This tool can be accessed via the IOpticalSystemTools interface, itself accessible via IOpticalSystem.Tools. More...

Inheritance diagram for ZOSAPI.Tools.FileManager.IConvertProjectToFileTool:

Public Member Functions

string GetOutputDirectoryName ()
 Gets the name of the output directory where the Lens File will be saved.
 
bool SetOutputDirectoryName (string directoryName)
 Sets the name of the directory where the Lens File will be saved.
 
IFile GetFileInUse (int fileIndex)
 Gets the file name for the specified file in the archive.
 
void SetFileOverwrite (int fileIndex, bool allowOverwrite)
 Sets a flag determining whether the file at the specified index will be overwritten if it already exists in the Root.
 
void SetFilesAllOverwrite ()
 All files will be overwritten if they exist.
 
void SetFilesNoOverwrite ()
 No files will be overwritten.
 
- 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.
 

Properties

int NumberOfFilesInUse [get]
 Gets the number of files used by the current system.
 
- 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.
 

Detailed Description

Tool for converting a Lens Project to a Lens File. This tool can be accessed via the IOpticalSystemTools interface, itself accessible via IOpticalSystem.Tools.

This is patterned off General.IRestoreArchive.

Member Function Documentation

◆ GetFileInUse()

IFile ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.GetFileInUse ( int  fileIndex)

Gets the file name for the specified file in the archive.

Parameters
fileIndexThe (array) index of the file (0 - NumberOfFilesInUse-1).
Returns

◆ GetOutputDirectoryName()

string ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.GetOutputDirectoryName ( )

Gets the name of the output directory where the Lens File will be saved.

Returns

◆ SetFileOverwrite()

void ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.SetFileOverwrite ( int  fileIndex,
bool  allowOverwrite 
)

Sets a flag determining whether the file at the specified index will be overwritten if it already exists in the Root.

Parameters
fileIndexThe (array) index of the file (see GetFileInUse).
allowOverwriteif set to true the file will be overwritten; otherwise it will be skipped.

◆ SetFilesAllOverwrite()

void ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.SetFilesAllOverwrite ( )

All files will be overwritten if they exist.

◆ SetFilesNoOverwrite()

void ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.SetFilesNoOverwrite ( )

No files will be overwritten.

◆ SetOutputDirectoryName()

bool ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.SetOutputDirectoryName ( string  directoryName)

Sets the name of the directory where the Lens File will be saved.

Parameters
directoryNameThe full name of the output directory.
Returns
true
if the specified directory name is valid and names an existing directory; otherwise,
false
.

Property Documentation

◆ NumberOfFilesInUse

int ZOSAPI.Tools.FileManager.IConvertProjectToFileTool.NumberOfFilesInUse
get

Gets the number of files used by the current system.

The number of files in use by the current system.

Connect with Ansys