Algosim documentation: SaveToFile

SaveToFile

Saves an object to a file-system file.

Syntax

Description

If X is any object and fn a valid, fully-qualified file name, then SaveToFile(X, fn) saves X to the file given by fn, overwriting any already existing file with this path and name.

The type and format of file created depends on the type of X:

If the file name is omitted, a standard dialog box is shown prompting for a file name.

If X is a reference to a 2D visual object, the following SVG export options may be specified:

If one of width and height is specified – but not both – the other will automatically be chosen in such a way that the aspect ratio is preserved. If both are left unspecified, the diagram’s current or last on-screen size is used. If both are specified, they determine the size of the SVG image. However, the SVG will be scaled proportionally, respecting its aspect ratio, unless stretch is explicitly set to true.

If X is a reference to a 3D visual object, width and height may be specified as integers.

export is a synonym for SaveToFile.

See also