Save and Restore Overview
List of: Discussion Topic
Subjects: SAT Save and Restore
Contents: Kernel

ACIS saves, or stores, model geometry information to ACIS save files (also known as SAT, part save files, or part files). ACIS also restores model information from these files. These files have an open format. Geometric entities are saved in the form of an entity list.

ACIS provides the API functions api_save_entity_list and api_restore_entity_list for saving models to and retrieving models from a disk file. Two additional API functions, api_save_entity_list_file and api_restore_entity_list_file, allow models to be saved and restored to media other than a stream file.

Applications use these functions in many ways. Single or multiple ENTITYs can be saved in a file, and applications can intermix their own data with ENTITY_LIST data. For testing or debugging purposes, it is possible to edit a file and remove all but the data of interest and load the file into a test or demonstration application, such as Scheme AIDE.

There are two types of ACIS save files: Standard ACIS Text (file extension .sat) and Standard ACIS Binary (file extension .sab). The only difference between these files is that the data is stored as ASCII text in a .sat file and in binary form in a .sab file. The organization of a .sat file and a .sab file is identical; the term SAT file is generally used to refer to both types.

Text file saves have the advantages of being human-readable and being portable between different platforms. Binary saves are not human-readable and may not be portable across platforms, but writing records in binary is roughly twice as fast as writing in text and the files are significantly smaller. Write and read binary files only by the same version running on the same type of hardware. ACIS can read and write any format of binary file on any platform. The selection of binary file format to be written is controlled by the binary_format option. The default format for writing a binary file is the native format of the machine on which it is being written.

Two sets of information may be available at any one time. There should always be information about what is going to be saved. That is stored in a FileInfo object and queried with the env:save-product-id/units Scheme extension. If one has recently retrieved a file, there should also be information about that file. It is stored in a FileInfo object and queried with the env:restored-product-id/units Scheme extension. Of course, both of these can be accessed through C++ by obtaining and querying the appropriate FileInfo object in the kernel context object.

Beginning with ACIS Release 6.3, it is required that the product ID and units be populated for the file header (using class FileInfo) before you can save a SAT file. Refer to the reference templates for class FileInfo and function api_set_file_info for more information.