Macros¶
-
tecplot.macro.
execute_command
(cmd)[source]¶ Runs a series of tecplot macro commands.
Parameters: cmd ( string
) – The macro commands to be run.Raises: TecplotMacroError
– Message will specify the command that failed.This command splits the input into individual commands and runs them one at a time. See the Tecplot Macro Scripting Guide for details about Tecplot 360 EX‘s macro language.
Warning
Currently, only commands that do not require raw data, by use of the
RAWDATA
macro directive, are accepted. See the Tecplot Macro Scripting Guide for more information about raw data.The following command will perform the same operations as the Hello, World! example:
>>> tecplot.macro.execute_command(r''' ... $!ATTACHTEXT ... ANCHORPOS { X = 35 Y = 50 } ... TEXTSHAPE { HEIGHT = 35 } ... TEXT = 'Hello, World!' ... $!EXPORTSETUP EXPORTFNAME = 'hello_world.png' ... $!EXPORT ... EXPORTREGION = CURRENTFRAME ... ''')
-
tecplot.macro.
execute_extended_command
(procid, cmd)[source]¶ Runs a tecplot macro command defined in an addon.
Parameters: Raises: In general, the command string is formatted prior to being fed into the Tecplot Engine so liberal use of whitespace, including new-lines, are acceptable.
Example:
>>> tecplot.macro.execute_extended_command( ... 'Multi Frame Manager', ... 'TILEFRAMESSQUARE')
-
tecplot.macro.
execute_file
(filename)[source]¶ Run a macro file.
Parameters: filename ( string
) – The file to be run.Raises: TecplotMacroError
Example:
>>> tecplot.macro.execute_file('/path/to/macro_file.mcr')