The Extend Macro add-on, libname "tecutilscript_extendmcr", extends the Tecplot macro language to include additional commands. You may use the Extend Macro add-on by adding the following function call to your macro file:
$!EXTENDEDCOMMAND COMMANDPROCESSORID='extendmcr' COMMAND='command option'
The commands supported by the add-on are listed in the following table
|
Command |
Notes |
QUERY.ZONENAMEBYNUM nnn VVV |
Get the string for zone nnn and assign to variable VVV. |
QUERY.VARNAMEBYNUM nnn VVV |
Get the string for variable nnn and assign to variable VVV |
QUERY.ZONENUMBYNAME "zonename" VVV |
Get the number of zone named zonename and assign to variable VVV |
QUERY.VARNUMBYASSIGNMENT assignment VVV |
Get the number of variable by assignment and assign to variable VVV. VVV may have any of the following values: • X, Y or Z - Variable assigned to the X, Y or Z-axis. • U, V or W - Variable assigned to be the U, V or W-vector component. • C -Variable assigned to contours. • S - Variable assigned to scatter sizing. • B - Variable assigned to the first constraint for value-blanking. |
QUERY.DATASETTITLE VVV |
Get the string for the dataset title and assign to variable VVV |
STRING.LENGTH StrSource VVV |
Get the length of string StrSource and assign to variable VVV. |
STRING.FINDPATTERN StrSource StrPattern VVV |
Get the sub-string from StrSource starting at pattern StrPattern and going to the end of StrSource. Returns "NOTFOUND" if not found. |
STRING.SUBSTRING StrSource start end VVV |
Get the sub-string from StrSource starting at position start and ending at position end. Put the result in VVV. |
QUERY.ACTIVEZONES VVV |
Get the set of active zones and put the result in VVV. Note: The set string does not include any blank spaces. If zones 2, 4, 6, 7 and 8 are active, VVV would have the string "2, 4, 6-8." |
QUERY.MAPNAMEBYNUM nnn VVV |
Returns a string (the name of the map) and places it in variable VVV. The active plot must be XY-Line or Polar-Line. |
QUERY.ISADDONLOADED COMMANDPROCESSORID VVV |
Return "YES" if Add-on COMMANDPROCESSORID is loaded, otherwise return "NO" |
QUERY.FILEEXISTS "filename" VVV |
If the file exists, VVV will be "YES" otherwise VVV will be "NO" |
QUERY.ISZONEACTIVE ZZZ VVV |
Test to see if zone ZZZ is active. If so, VVV is set to "YES," otherwise it is set to "NO." |
QUERY.LINEMAPZONEASSIGNMENT nnn VVV |
Get the zone number assigned to line map nnn and put the result in VVV. |
QUERY.ACTIVELINEMAPS VVV |
Get the set of active line maps and put the result in VVV.
Note: The set string does not include any blank spaces. If linemaps 2, 4, 6, 7, and 8 are active, VVV would have the string "2,4,6-8." |
QUERY.ISLINEMAPACTIVE nnn VVV |
Test to see if line map nnn is active. If so, VVV is set to "YES," otherwise it is set to "NO." VVV is set to "INVALID" if nnn <=0. |
FILE.APPENDSTRING "FileName" "String" |
Appends the given string to the indicated file, creating the file if necessary. FileName may be a relative path from Tecplot's working directory or an absolute path. |
FILE.APPENDLASTERROR "FileName" |
Appends the last error message, if any, to the indicated file, creating the file if necessary. FileName may be a relative path from Tecplot's working directory or an absolute path. If no Tecplot errors have occurred, this command will have no effect. |
If you have declared macro variables and would like to use them with the Extend Macro add-on, you can do so by surrounding the command call with single quotes and the macro variable with double-quotes.
For example:
$!VarSet |ZoneName| = "Unknown" |
$!EXTENDEDCOMMAND |
COMMANDPROCESSORID = "extendmcr" |
Command = 'query.zonenamebynum 1 "ZoneName"' |
$!RemoveVar |ZoneName| |
Refer to the Scripting Guide for additional information on working with Tecplot 360 EX's macro language.
QUERY.DATASETTITLE
The following example, uses the QUERY.DATASETITLE command to place the title of the dataset at a specific position on the plot.
$!VARSET |ZNUM| = "blank" |
|
$!EXTENDEDCOMMAND COMMANDPROCESSORID='extendmcr' COMMAND='QUERY.DATASETTITLE ZNUM' |
|
$!ATTACHTEXT |
XYPOS |
{ |
X = 5 |
Y = 90 |
} |
TEXT = "Title is: |ZNUM|" |
QUERY.VARNAMEBYNUM
The following example uses QUERY.VARNAMEBYNUM to place the name of variable 2 at a specific position on the plot.
$!VARSET |VNAME| = "X" |
|
$!EXTENDEDCOMMAND COMMANDPROCESSORID = 'extendmcr' COMMAND='QUERY.VARNAMEBYNUM 2 VNAME' |
|
$!ATTACHTEXT |
XYPOS |
{ |
X = 5 |
Y = 85 |
} |
TEXT = "Var 2 is: |VNAME|" |
QUERY.ZONENAMEBYNUM
The following example uses QUERY.ZONENAMEBYNUM to place the title of Zone 1 at a specific position on the plot.QUERY.ACTIVEZONES
$!VARSET |ZNAME| = "HELLO" |
|
$!EXTENDEDCOMMAND COMMANDPROCESSORID = 'extendmcr' COMMAND='QUERY.ZONENAMEBYNUM 1 ZNAME' |
|
$!ATTACHTEXT |
XYPOS |
{ |
X = 5 |
Y = 80 |
} |
TEXT = "Zone is: |ZNAME|" |
The follow example uses QUERY.ACTIVEZONES to display a list of the active zones.
$!VARSET |ZNUMS| = "blank" |
|
$!EXTENDEDCOMMAND COMMANDPROCESSORID='extendmcr' COMMAND='QUERY.ACTIVEZONES ZNUMS' |
|
$!ATTACHTEXT |
XYPOS |
{ |
X = 5 |
Y = 70 |
} |
TEXT = "Active zones are: |ZNUMS|" |
Refer to the Scripting Guide for additional information on working with Tecplot 360 EX's macro language.