history:save
List of: Scheme Extensions
Subjects: History and Roll
Contents: Scheme Support

Action: Saves all entities, entity-id, and roll information associated with a history stream to a file.

Filename: scm/scmext/part_scm.cxx

APIs: api_save_history, api_save_version

Syntax: (history:save filename [text-mode=#t]


[save-type="entire"] [history])

Arg Types: filename string

text-mode boolean

save-type string

history history

Returns: boolean

Description: The filename specifies a filename to be saved in the current working directory or specifies the path that includes the filename to be saved to a directory.


If textmode is #t, the data is saved in text mode. If textmode is not specified, then the mode is determined by the extension of the filename. If the filename string ends in .sab or .SAB, then the file is saved in binary mode; otherwise, the file is saved in text mode (.sat).


The save-type string can be one of "entire-history", "mainline", or "active-only". Only the first character of the string is examined. The non-default "mainline" and "active-only" options limit the amount of roll information stored in the history data: "mainline" indicates that rolled branches are not saved while "active-only" saves only active entities (and their creation history data) and their id information.|


Files can be saved in the format of an earlier version by setting the save_version option.


The optional history specifies the history stream to save; if this is not specified the default history stream is used.

Example: ; history:save

; Create a solid block.

(define block1


(solid:block (position 0 0 0)


(position 10 10 10)))

;; block1

; Save the history_stream of the currently-active

; part to the named file.

(history:save "myblock.sat"


(history (env:active-part)))

;; #t

; Set the save_version option to ACIS 1.7.

(option:set "save_version" 107)

;; 800

; Save the solid block again in ACIS 1.7 format.

(history:save "myblock17.sat"


(history (env:active-part)))

;; #t
PDF/SCM/04SC.PDF
HTM/DATA/SCM/SCM/04SC/0062.HTM