Functions | |
Boolean_t | TecUtilMacroRunFunction (const char *QuickMacroName, const char *MacroParameters) |
Run a macro function. | |
Boolean_t | TecUtilMacroPanelAddTitle (const char *Title) |
Add a title to a page in the Quick Macro Panel. | |
Boolean_t | TecUtilMacroRunFile (const char *FName) |
Run a macro file. | |
Boolean_t | TecUtilMacroAddCommandCallback (const char *CommandProcessorIDString, MacroCommandExtCallback_pf MacroCommandCallback) |
Include a function in the list of functions to call when the $!EXTENDEDCOMMAND macro command is processed. | |
Boolean_t | TecUtilMacroRecordExtCommand (const char *CommandProcessorIDString, const char *Command) |
Instruct Tecplot to record a macro command to the macro file which is currently being recorded. | |
Boolean_t | TecUtilMacroRecordAddOnCommand (const char *AddOnIDString, const char *Command) |
| |
Boolean_t | TecUtilMacroRecordExtComRaw (const char *CommandProcessorIDString, const char *Command, const char *RawData) |
Instruct Tecplot to record a macro command, that includes raw data, to the macro file. | |
Boolean_t | TecUtilMacroRecordAddOnComRaw (const char *AddOnIDString, const char *Command, const char *RawData) |
| |
Boolean_t | TecUtilMacroRecordRawCommand (const char *Command) |
Send anything you want to the Tecplot record file. | |
Boolean_t | TecUtilMacroExecuteCommand (const char *Command) |
Instruct Tecplot to execute a single macro command. | |
Boolean_t | TecUtilMacroSetMacroVar (const char *MacroVar, const char *ValueString) |
Set the value for a macro variable. | |
Boolean_t | TecUtilScriptExecRegisterCallback (const char *FileExt, const char *ScriptLanguage, ScriptExecCallback_pf ScriptExecCallback, ArbParam_t ClientData) |
Registers the script execution callback and client data with the specified file extension. | |
Boolean_t | TecUtilScriptExec (const char *FileName) |
Executes the specified script file. | |
Boolean_t | TecUtilScriptProcessorGetClientData (const char *ScriptExtension, ArbParam_t *ClientData) |
Returns client data associated with a script processor. | |
Boolean_t | TecUtilStateIsProcessingMacro (void) |
Determine if Tecplot is currently playing a macro. | |
Boolean_t | TecUtilStateIsProcessingStylesheet (void) |
Determine if Tecplot is currently processing a stylesheet. | |
Boolean_t | TecUtilMacroFunctionExists (const char *FunctionName) |
Query Tecplot to see if a macro function called FunctionName exists. | |
Boolean_t | TecUtilMacroIsBatchModeActive (void) |
Determine if Tecplot is currently running in batch mode. | |
Boolean_t | TecUtilMacroIsRecordingActive (void) |
Determine if Tecplot is currently recording a macro. |
Boolean_t TecUtilMacroAddCommandCallback | ( | const char * | CommandProcessorIDString, | |
MacroCommandExtCallback_pf | MacroCommandCallback | |||
) |
Include a function in the list of functions to call when the $!EXTENDEDCOMMAND macro command is processed.
This allows you to extend Tecplot's macro language, so that commands needed to perform operations in your application or add-on can be included in a Tecplot macro.
CommandProcessorIDString | A unique string used to determine the function to call when an $!EXTENDEDCOMMAND macro command is processed. Each application or add-on should have its own unique ID string. For example, if a file converter add-on responsible for converting DXF files for Tecplot defines an ID string of "DXFCONVERTTOOL-1.2" then this same ID string must be used in the calls to TecUtilMacroRecordExtCommand() and TecUtilMacroAddCommandCallback(). | |
MacroCommandCallback | Name of the function to call when the $!EXTENDEDCOMMAND macro command is processed. The callback function you provide will have the following syntax:. |
INTEGER*4 FUNCTION TecUtilMacroAddCommandCallback( & CommandProcessorIDString, & MacroCommandCallback) CHARACTER*(*) AddOnIDString EXTERNAL MacroCommandCallback
Python Syntax:
This function is not supported in Python.
The following example shows how an add-on can augment the Tecplot macro language with the commands "GO" and "STOP." First create a function that will be called by Tecplot when a "GO" or "STOP" command is encountered in a macro file.
Boolean_t ProcessBananaCommands(char *Command, char **ErrMsg) { Boolean_t IsOk = TRUE; if (strcmp(Command,"GO") == 0) { // code here to execute a GO command } else if (strcmp(Command, "STOP") == 0) { // code here to execute a STOP command } else { *ErrMsg = TecUtilStringAlloc(80, "Error message string"); sprintf(*ErrMsg, "Unknown BANANA command"); IsOk = FALSE; } return IsOk; }
In the initialization code for your add-on, register the function with:
. . TecUtilMacroAddCommandCallback("BANANA", ProcessBananaCommands); . .
Boolean_t TecUtilMacroExecuteCommand | ( | const char * | Command | ) |
Instruct Tecplot to execute a single macro command.
The macro command is supplied as a string. Currently this command is restricted as follows: ? Only commands that do not require raw data are accepted. ? Command must be all on one line-no newlines. See the Tecplot Reference Manual for details about Tecplot's macro language.
Command | Macro command. This must not be NULL |
INTEGER*4 FUNCTION TecUtilMacroExecuteCommand(Command) CHARACTER*(*) Command
Python Syntax:
Results = TecUtil.MacroExecuteCommand(Command) Input: Command string Output: Results[0] ReturnVal boolean
Execute a macro command to animate the I-planes:
TecUtilMacroExecuteCommand("$!ANIMATEIJKPLANES PLANES = I");
Boolean_t TecUtilMacroFunctionExists | ( | const char * | FunctionName | ) |
Query Tecplot to see if a macro function called FunctionName exists.
FunctionName | Name of the macro function. |
INTEGER*4 FUNCTION TecUtilMacroFunctionExists(FunctionName) CHARACTER*(*) FunctionName
Python Syntax:
Results = TecUtil.MacroFunctionExists(FunctionName) Input: FunctionName string Output: Results[0] ReturnVal boolean
If the macro function "abc" exists, then execute it.
if (TecUtilMacroFunctionExists("abc")) { TecUtilMacroRunFunction("abc",(char *)NULL); }
Boolean_t TecUtilMacroIsBatchModeActive | ( | void | ) |
Determine if Tecplot is currently running in batch mode.
This function is Thread Safe.
INTEGER*4 FUNCTION TecUtilMacroIsBatchModeActive()
Python Syntax:
Results = TecUtil.MacroIsBatchModeActive()
Output:
Results[0] ReturnVal boolean
Perform some operations if Tecplot is not running in batch mode:
if (!TecUtilMacroIsBatchModeActive()) { // Perform some operations }
Boolean_t TecUtilMacroIsRecordingActive | ( | void | ) |
Determine if Tecplot is currently recording a macro.
INTEGER*4 FUNCTION TecUtilMacroIsRecordingActive()
Python Syntax:
Results = TecUtil.MacroIsRecordingActive()
Output:
Results[0] ReturnVal boolean
If Tecplot is currently recording a macro, record the macro command "GO" for the addon "BANANA":
if (TecUtilMacroIsRecordingActive()) { TecUtilMacroRecordExtCommand("BANANA", "GO"); }
Boolean_t TecUtilMacroPanelAddTitle | ( | const char * | Title | ) |
Add a title to a page in the Quick Macro Panel.
Title | String containing the title. Each call to TecUtilMacroPanelAddTitle() adds a title to successive pages in the Quick Macro Panel |
INTEGER*4 FUNCTION TecUtilMacroPanelAddTitle(Title) CHARACTER*(*) Title
Python Syntax:
Results = TecUtil.MacroPanelAddTitle(Title) Input: Title string Output: Results[0] ReturnVal boolean
Add the title "Flow Options" to the next macro panel:
TecUtilMacroPanelAddTitle("Flow Options");
Boolean_t TecUtilMacroRecordAddOnCommand | ( | const char * | AddOnIDString, | |
const char * | Command | |||
) |
Python Syntax:
Results = TecUtil.MacroRecordAddOnCommand(AddOnIDString, Command) Input: AddOnIDString string Command string Output: Results[0] ReturnVal boolean
Boolean_t TecUtilMacroRecordAddOnComRaw | ( | const char * | AddOnIDString, | |
const char * | Command, | |||
const char * | RawData | |||
) |
Python Syntax:
Results = TecUtil.MacroRecordAddOnComRaw(AddOnIDString, Command, RawData) Input: AddOnIDString string Command string RawData string Output: Results[0] ReturnVal boolean
Boolean_t TecUtilMacroRecordExtCommand | ( | const char * | CommandProcessorIDString, | |
const char * | Command | |||
) |
Instruct Tecplot to record a macro command to the macro file which is currently being recorded.
CommandProcessorIDString | Unique string to identify command as belonging to a particular command processor. Use TecUtilMacroAddCommandCallback() to install a callback function. | |
Command | Character string containing the command. This command must be one that your command processor understands since it will be passed to the function you register with TecUtilMacroAddCommandCallback(). |
Command String must have a valid address and non-zero length.
INTEGER*4 FUNCTION TecUtilMacroRecordExtCommand( & CommandProcessorIDString, & Command) CHARACTER*(*) AddOnIDString CHARACTER*(*) Command
Python Syntax:
Results = TecUtil.MacroRecordExtCommand(CommandProcessorIDString, Command) Input: CommandProcessorIDString string Command string Output: Results[0] ReturnVal boolean
Boolean_t TecUtilMacroRecordExtComRaw | ( | const char * | CommandProcessorIDString, | |
const char * | Command, | |||
const char * | RawData | |||
) |
Instruct Tecplot to record a macro command, that includes raw data, to the macro file.
CommandProcessorIDString | Unique string to identify command as belonging to a particular command processor. Use TecUtilMacroAddCommandCallback() to install a callback function. | |
Command | Character string containing the command. This command must be one that your command processor understands since it will be passed to the function you register with TecUtilMacroAddCommandCallback(). | |
RawData | Character string containing the raw data. This text will follow a RAWDATA marker in the macro file. Use of newlines to organize the raw data in a readable fashion is encouraged. The RawData section cannot contain the $! since the $! marks the start of a Tecplot macro command. The # may be used in the raw data, however all text following the # up to the following newline will be discarded when the macro is processed. When the $!EXTENDEDCOMMAND is later processed by Tecplot the text in the RAWDATA section will be concatenated to the command string (including a newline (\n) to separate the command from the raw data. |
Command String must have a valid address and non-zero length.
RawData String must have a valid address and non-zero length.
INTEGER*4 FUNCTION TecUtilMacroRecordExtComRaw( & CommandProcessorIDString, & Command, & RawData) CHARACTER*(*) CommandProcessorIDString CHARACTER*(*) Command CHARACTER*(*) RawData
Python Syntax:
Results = TecUtil.MacroRecordExtComRaw(CommandProcessorIDString, Command, RawData) Input: CommandProcessorIDString string Command string RawData string Output: Results[0] ReturnVal boolean
Record an add-on command that has the text "3.7 9.4" in the RAWDATA section:
if (TecUtilMacroIsRecordingActive()) { TecUtilMacroRecordExtComRaw("MyMacroProcessor", "LOADXY", "3.7 9.4"); }
Boolean_t TecUtilMacroRecordRawCommand | ( | const char * | Command | ) |
Send anything you want to the Tecplot record file.
Command | Character string to write to the record file. You can send anything you want |
INTEGER*4 FUNCTION TecUtilMacroRecordRawCommand(Command) CHARACTER*(*) Command
Python Syntax:
Results = TecUtil.MacroRecordRawCommand(Command) Input: Command string Output: Results[0] ReturnVal boolean
Record commands that will cause Tecplot to loop to animate 3 zones when the macro is played back:
if (TecUtilMacroIsRecordingActive()) { TecUtilMacroRecordRawCommand("$!Loop 3\n" "$!ActiveFieldZones[|Loop|]\n" "$!Redraw\n" "$!EndLoop\n");
Boolean_t TecUtilMacroRunFile | ( | const char * | FName | ) |
See the Tecplot Reference Manual for details about Tecplot macro files.
FName | The name of the macro file to run. This should be the full path to the macro file. If the full path is not specified, any relative paths in your macro file may not be correctly resolved. |
INTEGER*4 FUNCTION TecUtilMacroRunFile(FName) CHARACTER*(*) FName
Python Syntax:
Results = TecUtil.MacroRunFile(FName) Input: FName string Output: Results[0] ReturnVal boolean
Load and run the macro file mymacro.mcr:
TecUtilMacroRunFile("C:\\mymacro.mcr");
Boolean_t TecUtilMacroRunFunction | ( | const char * | QuickMacroName, | |
const char * | MacroParameters | |||
) |
See the Tecplot Reference Manual for details about Tecplot macro functions.
QuickMacroName | The name of the macro function to run | |
MacroParameters | Any parameters which QuickMacroName requires. Pass NULL for macro functions which require no parameters |
MacroParameters Pointer must be a valid address or NULL.
INTEGER*4 FUNCTION TecUtilMacroRunFunction( & QuickMacroName, & MacroParameters) CHARACTER*(*) QuickMacroName CHARACTER*(*) MacroParameters
Python Syntax:
Results = TecUtil.MacroRunFunction(QuickMacroName, MacroParameters) Input: QuickMacroName string MacroParameters string Output: Results[0] ReturnVal boolean
Run a macro function called "Calculate" which takes no parameters and another macro function called "Display" which takes the name of a layout file and an integer as parameters:
TecUtilMacroRunFunction("Calculate", (char *)NULL); TecUtilMacroRunFunction("Display", "(\"contour.lay\", 2)");
Boolean_t TecUtilMacroSetMacroVar | ( | const char * | MacroVar, | |
const char * | ValueString | |||
) |
Set the value for a macro variable.
Any macro executed after this call may then reference the value using |macrovar|.
MacroVar | Name of the macro variable you want to assign a value. | |
ValueString | Value to assign to MacroVar. Must be a valid string of length greater than zero |
ValueString Pointer must be a valid address and non-NULL.
INTEGER*4 FUNCTION TecUtilMacroSetMacroVar( & MacroVar, & ValueString) CHARACTER*(*) MacroVar CHARACTER*(*) ValueString
Python Syntax:
Results = TecUtil.MacroSetMacroVar(MacroVar, ValueString) Input: MacroVar string ValueString string Output: Results[0] ReturnVal boolean
Assign a file name to the macro variable FNAME, then use it in a Tecplot macro:
IsOk = TecUtilMacroSetMacroVar("FName","/home/george/test.dat"); .... In a later macro you can reference |FName|: $!ReadDataSet "|FName|"
Boolean_t TecUtilScriptExec | ( | const char * | FileName | ) |
Executes the specified script file.
Tecplot locates the script execute callback based upon the file name extension.
FileName | Script file name to execute. |
Results = TecUtil.ScriptExec(FileName) Input: FileName string Output: Results[0] ReturnVal boolean
Boolean_t TecUtilScriptExecRegisterCallback | ( | const char * | FileExt, | |
const char * | ScriptLanguage, | |||
ScriptExecCallback_pf | ScriptExecCallback, | |||
ArbParam_t | ClientData | |||
) |
Registers the script execution callback and client data with the specified file extension.
When Tecplot encounters a file with the given extension it hands it off to the callback to execute.
FileExt | File extension, such as "tcl" or "py", to associate with the script execution callback and client data. | |
ScriptLanguage | Name of the scripting language. This name could be displayed in a Tecplot menu or dialog. | |
ScriptExecCallback | Callback responsible for executing the script handed to it by Tecplot. | |
ClientData | Any client data needed by the callback. |
This function is not supported in Python.
Boolean_t TecUtilScriptProcessorGetClientData | ( | const char * | ScriptExtension, | |
ArbParam_t * | ClientData | |||
) |
Returns client data associated with a script processor.
ScriptExtension | An extension for which the script processor was registered. | |
ClientData | A pointer to an ArbParam_t variable to receive the client data. |
ClientData Pointer must be a valid address and non-NULL.
This function is not supported in Python.
Boolean_t TecUtilStateIsProcessingMacro | ( | void | ) |
Determine if Tecplot is currently playing a macro.
INTEGER*4 FUNCTION TecUtilStateIsProcessingMacro()
Python Syntax:
Results = TecUtil.StateIsProcessingMacro()
Output:
Results[0] ReturnVal boolean
Boolean_t TecUtilStateIsProcessingStylesheet | ( | void | ) |
Determine if Tecplot is currently processing a stylesheet.
INTEGER*4 FUNCTION TecUtilStateIsProcessingStylesheet()
Python Syntax:
Results = TecUtil.StateIsProcessingStylesheet()
Output:
Results[0] ReturnVal boolean