Macro Language Reference > Macros > Document > tsave
  
tsave
Description
Saves the current document, or portions of it, to a file. The only difference between the tsave and tsaven macros is how they behave when the parameters are omitted. The tsave macro will automatically save the whole document under its current file name, unless its extension is .3f (used for PTC ALD template files), in which case it will behave like tsaven and invoke a dialog box into which you may type a file name.
 
Example 54. Save current document
The macro shown below simply saves the current document:
tsave
If the file is of type .3f, the Save Document dialog box will prompt you to enter a new name.
 
Example 55. Save the current document with a new name
The macro shown below saves the current document -test1.3d - under a new name, but still in .3d format. The previous version of the document will not be deleted or overwritten. The new file will be called test2.3d and will by default be saved in PTC ALD working directory, usually \3d.
tsave "test2"
 
Example 56. Save an object graphic to file
This macro saves an object graphic with the tag name object to file. The file name will be object.3o:
tsave "object.3o"
 
Example 57. Save a defined colour as a tag within a document
The example below saves a defined colour as a tag within document, so that the c,m,y,k can be retrieved:
tsave "{0}PANTONE_E_2-3_CVP.3x"
If your colour name is "COLOUR_TAG", execute the following macro:
tsave "{0}COLOUR_TAG.3x"
This will create a text tag in your document called "COLOUR_TAG." (with trailing dot). You can examine this to get the PTC ALD definition. If required, you can change the definition to replace the existing colour by executing the following macro:
tload "{0}COLOUR_TAG."
The Tag Clash dialog box will appear on your screen. If you do not want to change this definition, delete the old colour tag first or use the wdb macro to force the Replace button when the dialog appears.
Syntax
tsave default:n? ( file:s options:s? )?
tsave
[no parameter]
tsave saves the current document as a .3d file unless its file extension is .3f. In this case tsave behaves like tsaven and displays the Save Document dialog box.
default
0
tsave will save the current document as a .3d file, unless another extension is specified in the file parameter
1
tsave will save the current document as a .3f file unless another extension is specified in the file parameter
file
The file name under which you want to save the current document or a portion of it. The first part of file is either an optional prefix which you can specify, or the name of the entity within the file that you want to save. The second part of file is an extension, either .3d or .3f, or one of the special file suffixes listed below. Any entity saved with the special extensions can be loaded into any other document with the tload macro.
.3d
Save the file as a normal .3d document. If the file is an PTC ALD template file (.3f) the Save Document dialog box will be invoked.
.3c
Save named colours only. Names not truncated on Windows 95/NT.
.3f
Save the file as an PTC ALD template file. This is particularly useful if you make changes to the template files supplied with PTC ALD and want to carry on listing them as an option for selection when you open a new document.
.3h
Save tag header information only. This is useful when integrating PTC ALD with an external program. The file contains tag headers plus complete fdb, fdp, fdd, fdpref and fde blocks.
.3o
Save an object graphic. The file prefix comes from the tag name of the object graphic. If this is longer than eight characters the file name is truncated.
.3p
Save document preferences (exception: those set up with the tdpref, tdslevel and tdplevel macros will not be included) to a specified file whose file prefix you specify.
.3r
Save a raster graphic. The file prefix is the tag name of the raster graphic. If this is longer than eight characters the file name is truncated.
.3s
Save all style tags to a specified file whose file prefix you specify. This can be useful for transferring all of your styles to another document.
.3t
Save a text stream. The file prefix is the tag name of the text stream. If this is longer than eight characters the file name is truncated.
.3x
Save any entity. The type of the entity is not important (as it is with the .3t, .3o and .3r extensions). This extension can also be used to save page over/underlay layouts. The file prefix is the tag name of the entity you want to save. If this is longer than eight characters the file name is truncated.
.3z
Save the file as an application bundle (from version 9.1 onwards).
options
a
Save all (normal save)
o
Overwrite an existing file without prompting: should be used together with the a option. (Added in version 8.13v).
Related Links