next up previous contents index
Next: Database Up: Control Functions Previous: Control Functions   Contents   Index


Current Cell

(int) Edit(name, symname)
This function will read in the named file or cell and make it, or one of the cells in the hierarchy, the current cell. If the present cell has been modified, in graphics mode the user is prompted for whether to save the cell before reading the new one. The name argument can be null or empty, in which case the user will be prompted for a file or cell to open for editing, if in graphics mode. If not in graphics mode, an empty cell is created in memory and made the current cell.

The name provided can be an archive file, the name of an Xic cell, or a library file. If the name of an archive file is given, the name of the cell to open can be provided as symname. If symname is null or empty, the top level cell (the one not used as a subcell by any other cells in the file) is the one opened for editing. If there is more than one top level cell, in graphics mode the user is presented with a pop-up choice menu and asked to make a selection. If the file is a library file, the symname can be given, and it should be one of the reference names from the library, or the name of a cell defined in the library. If symname is null or empty, in graphics mode a pop-up listing the library contents will appear, allowing the user to select a reference or cell. If not in graphics mode, and the cell to edit can not be determined, the current cell is unchanged, and nothing is read.

The symname must be the name after any aliasing is applied.

When reading an archive file, the dimensions are scaled according to the current scale for reading. This scale can be set with the SetConvertScale function, or from the Conversion - Import panel in Xic.

The return value is one of the following integers, representing the command status:

-2 The function call was reentered. This is not likely to happen in scripts.
-1 The user aborted the operation.
0 The open failed: bad file name, parse error, etc.
1 The operation succeeded.
2 The read was successful on an archive with multiple top-level symbols but the symbol to edit can't be determined. The current cell has not been set, but the cells are in memory. The second argument could have been used to resolve the ambiguity.
3 The cell name was the name of the device library or model library file, which has been opened for text editing (in graphic mode only).

(int) OpenCell(name, symname)
This function will read a cell (and subcells) into memory, but unlike the Edit function, the new cell will not be the current cell. Once in memory, the cell is available by its simple name, for use by the Place function for example. If name is the name of an archive or library file, symname is the cell or reference to open, similar to the Edit function.

When reading an archive file, the cell is scaled according to the current scale for reading. This scale can be set with the SetConvertScale function, or from the Conversion - Import panel in Xic.

The return value is 1 on success, 0 otherwise.

(string) NewCellName()
This function returns a string which is a valid cell name that does not conflict with any cell in the current symbol table. The cell is not actually created. This can be used with the Edit function to open a new cell for editing, similar to the New button in the File Menu. This function never fails.

(int) ClearCell(undoable, layer_list)
This function will clear the content of the present mode (electrical or physical) part of the current cell. If the first argument is nonzero, the deletions will be added to the internal undo list, otherwise not. The latter is more efficient, though this makes the deletions irreversible. The second argument, if null or empty, indicates that all objects on all layers will be deleted, including subcells. Otherwise this can be set to a string containing a space-separated list of layer names, following an optional special character `!' or `^' which must be the first character in the string if used. If the special character does not appear, the deletions apply only to the layers listed. If the special character appears, the deletions apply only to the layers not listed. Recall that the internal name for the layer that contains subcels ls ``$$'', thus for example using ``! $$'' would delete all geometry but retain the subcells.

The return value is the number of objects deleted.

(int) Push(object_handle)
This function will push the editing context to the cell of the instance referenced by the handle. The handle is the return value from the SelectHandle or AreaHandle functions. This is similar to the Push command in Xic. The editing context can be restored with the Pop function. If successful, 1 is returned, otherwise 0 is returned. This function will fail if the handle passed is not a handle to an object list.

This function implicitly calls Commit before the context change.

(int) Pop()
This function will pop the editing context to the parent cell, to be used after the Push function or a Push command in Xic. The Pop function always returns 1, and has no effect if there was no corresponding push.

This function implicitly calls Commit before the context change.

(string) CurCellName()
The return value of this function is a string containing the name of the current cell.

(string) TopCellName()
The return value of this function is a string containing the name of the top level cell in the hierarchy being edited. This is different from the current cell name while in a subedit (i.e., the Push command is active).

(string) FileName()
This function returns the name of the file from which the current cell was read. If there is no such file, a null string is returned.

(int) CurCellBB(array)
This function will return the bounding box of the current cell, in microns, in the array, as l, b, r, t. The array must have size 4 or larger. The function returns 1 on success, 0 if there is no current cell.

(int) Save(newname)
This function will save to disk file the current cell, and its descendents if the cell originated from an archive file. If the argument is null or the empty string, the current cell name is used, suffixed with one of the following if saving as an archive:

CGX .cgx
CIF .cif
GDSII .gds
OASIS .oas

The default format will be the format of the original input file, though format conversion can be imposed by adding one of these suffixes or ``.xic'' to newname. The cell is saved unconditionally; there is no user prompt.

(int) UpdateNative(dir)
This will write to disk all of the modified cells in the current hierarchy as native cell files in the directory given as the argument. If the argument is null or empty, cells will be written in the current directory. The return value is the number of cells written.

Note that only modified or internally created cells will be written. To write all cells as native cell files, use the ToXIC function.


next up previous contents index
Next: Database Up: Control Functions Previous: Control Functions   Contents   Index
Stephen R. Whiteley 2006-10-23