Command
QisLib_SaveGDSIIStructure

QisLib_SaveGDSIIStructure


Function:
	int QisLib_SaveGDSIIStructure(const char* TargetFileName);

Inputs:
	TargetFileName: Name and path of the file to which the cell is to be saved.

Return:
	success: 0
	failure: one of the following values :

Errors:
	1: No GDSII file has been opened.
	2: Cannot save GDSII file from memory maps.
	-1: QisLib has not been initialized.
	-2: Cannot open the specified target file name.
	-3: No GDSII file loaded in memory.
	-4: Internal memory failure occurred while saving GDSII file.
	-5: Cannot save to multiple files at one time.
	-6: Disk error occurred while writing to the target file.
	-7: The specified cell does not exist.
	-8: Internal error occurred while performing save operation.
	-9: The specified input is invalid (null).
	-10: File open in progress, operation not permitted.

Description:
	- This function saves the currently opened cell and all the cells it references down
	the hierarchy to the output file.
	- This operation has same effect as extracting the current cell from the GDSII file
	while preserving the hierarchy. This function is simillar to QisLib_SaveGDSII.
	- This function will work only if the input GDSII file has been opened in edit mode.
	(QisLibSetLoadMemory was on during QisLib_OpenGDSII or a new GDSII file was created
	using QisLibNewGDSII) It will not work for OASIS files.
	- QisLib_SaveGDSIIStructure will also fail if GDSII file was opened directly from
	memory maps using QisLib_OpenMemoryMaps.
	- Any changes made to the polygons, layers for the specified cell will be reflected.
	- The cell hierarchy is preserved during this operation.
	- This command does not save settings such as layer on/off, nesting level, array mode,
	etc.
	- Data is output on the same layer as the input. However QisLib_SetOutputLayerMap can
	be used to control the mapping of the input layers to different output layers.
	- If a progress message callback function has been set using
	QisLib_SetProgressMessageCallback, QisLib updates the file save percentage to the
	user program while this function is executing.
	- Boxes are saved as boxes regardless of the QisLib_SetBoxBoundary setting.
	- The Grid and Unit values of the output GDSII file can be controlled by using
	QisLib_SetDBU and QisLib_SetResolution. By default, these values will be same as the
	input GDSII file.
	- If this operation needs to be cancelled, use QisLib_Stop. This can only be done if
	QisLib_SetProcessEvents is turned on. Also, for Unix/Linux, the program's
	application context must be passed to QisLib_InitLib.

References:
QisLib_SaveGDSII
QisLib_SetOutputLayerMap
QisLib_OpenMemoryMaps
QisLib_SetLoadMemory
QisLib_NewGDSII
QisLib_SetBoxBoundary
QisLib_SetDBU
QisLib_Stop
QisLib_SetResolution