Skip to main content

Zemax OpticStudio ZOS-API 2026 R1

Interface ZOSAPI::Tools::General::IRestoreArchive

Last update: 13.03.2026

Definition:

Interfaces and methods for restoring a ZAR file. This interface can be accessed via the IOpticalSystemTools interface.

Inherits from:

Members

Properties

Property ArchiveFile

Definition:

string ZOSAPI.Tools.General.IRestoreArchive.ArchiveFile

Gets the name of the currently selected input archive.

The full path to the archive file.

Return type: string

Property NumberOfFilesInArchive

Definition:

int ZOSAPI.Tools.General.IRestoreArchive.NumberOfFilesInArchive

Gets the number of files stored in the specified archive.

The number of files in archive.

Return type: int

Property ExtractAllFilesToProjectDirectory

Definition:

bool ZOSAPI.Tools.General.IRestoreArchive.ExtractAllFilesToProjectDirectory

Return type: bool

Public functions

Function SetFileName

ArchiveFileStatus ZOSAPI.Tools.General.IRestoreArchive.SetFileName(string archiveFile)

Sets the name of the input archive.

Parameters:

  • archiveFile: The full path to the archive file.

Returns:

The results from trying to read the archive.

Parameters:

  • string archiveFile

Return type: ArchiveFileStatus

Function GetOutputFolder

string ZOSAPI.Tools.General.IRestoreArchive.GetOutputFolder()

Gets the currently selected output folder.

Returns:

Return type: string

Function SetOutputFolder

bool ZOSAPI.Tools.General.IRestoreArchive.SetOutputFolder(string folder)

Sets the desired output folder.

Parameters:

  • folder: The folder.

Returns:

true

if the specified folder is valid and exists; otherwise,

false

.

Parameters:

  • string folder

Return type: bool

Function GetFileNameInArchive

string ZOSAPI.Tools.General.IRestoreArchive.GetFileNameInArchive(int fileNumber)

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

Parameters:

  • fileNumber: The file number (0 - NumberOfFilesInArchive-1).

Returns:

Parameters:

  • int fileNumber

Return type: string

Function SetFileOverwrite

void ZOSAPI.Tools.General.IRestoreArchive.SetFileOverwrite(int fileNumber, bool allowOverwrite)

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

Parameters:

  • fileNumber: The file number (see GetFileNameInArchive).
  • allowOverwrite: if set to true the file will be overwritten; otherwise it will be skipped.

Parameters:

  • int fileNumber
  • bool allowOverwrite

Return type: void

Function SetFilesAllOverwrite

void ZOSAPI.Tools.General.IRestoreArchive.SetFilesAllOverwrite()

All files will be overwritten if they exist.

Return type: void

Function SetFilesNoOverwrite

void ZOSAPI.Tools.General.IRestoreArchive.SetFilesNoOverwrite()

No files will be overwritten.

Return type: void

Connect with Ansys