Macro Language Reference > Macros > Tag > tlink
  
tlink
Description
Links a text stream to a file, allowing you to specify the kind of link to be made.
 
Example 266. Link text stream to a file
The macro shown below links the text stream as an PTC ALD link to the file strm0.3t:
tlink "strm0", "c:/3d/strm0.3t", 2:tlsave
Note the inclusion of tlsave to save the link: this is equivalent to clicking the save-link_en button in the tag linking dialog box.
 
Example 267. Linking to a file when in Text Mode
If strm0 is in the currently selected frame, and PTC ALD is in Text Mode, the following will have the same effect as the first example:
tlink "c:/3d/strm0.3t", 2:tlsave
 
Example 268. Linking to a text file when not in Text Mode
If PTC ALD is in Text Mode, but you still want to link the text file in the frame, you have to specify the entity explicitly:
tlink 0, "c:/3d/strm0.3t", 2:tlsave
 
Example 269. Link a raster not originally loaded as a link
If a raster was not loaded as a link, but you now want to link it, it can be made into a link with the following syntax:
tlink 2, 1:tlsave
 
Example 270. Break file links
It is often useful to break file links, for instance if you want to send a single file to another person. Before breaking a file link so as to bring the file back into your .3d file you must, however, ensure that the linked file has been called for by PTC ALD and brought into your document, otherwise an empty header will be saved. You can use tlupdate to do this. Omitting the link_file and changing the value of link_type to 0 breaks the file links:
tlink 0, 0:tlsave
Syntax
tlink tags:s? link file:s? link type:n?
tlink
[no parameter]
Invoke the Tag Linking dialog box.
tags
This parameter can take one of the two options below.
tag name
The name of the tag to be linked
tag prep
Prepare the current context tag or specific tags for linking using the values detailed below:
Ø
In Page Mode: prepare the raster in the currently selected frame for linking
In Text Mode: prepare the text tag in the currently selected frame for linking
In Graphics Mode: prepare the object graphics tag in the currently selected frame for linking.
0
Prepare the text tag in the currently selected frame for linking
1
Prepare the object graphic tag in the currently selected frame for linking
2
Prepare the raster graphic tag in the currently selected frame for linking
link file
The name of the file to which tag is to be linked.
link type
The type of file to which tag is to be linked:
0
None: the tag will not be linked to a file. This is useful for breaking existing file links.
1
Original: the tag will be linked to the original file in its native format as imported into PTC ALD . If you make changes to a file with this type of link within a document, you will be warned and prompted to re-save the link with a link type.
2
3B2: the tag will be linked to a file in the appropriate format for text, rasters or object graphics.
3
3B2 library
4
Script: a script file can be linked to a tag but still be editable. without having to break the link.
* 
If you change both the tag and the file at the same time, edits may still be lost.
Additional Information
In order to create or break links from a macro the tag to be linked must be specified as either an entity of the current frame or by tag name, and followed in both cases by the link type. The link type can optionally be preceded by the name of the link file.