Tecplot Macros

Macros are useful for streamlining repetitive operations, executing multi-step tasks quickly, and performing operations that can’t easily be done interactively. They are recordable, easy to edit, and don’t require any development experience.  Better yet, the Tecplot support and development teams have put together these handy Basic Macros and Quick Macro Panel (QMP) files that can be customized to help you automate a variety of tasks.

Macro variables, commands, batch processes, and movie file creation are explained in the Tecplot 360 and Tecplot Focus Scripting Guides and User’s Manual.

Basic Macros

Download any of the .mcr files below, use a text editor to modify it to fit your needs, open it in your Tecplot software, and you should be ready to go.

What the Basic Macro does Click filename to download
Makes a group of points follow an XY curve. anim_xycurve.mcr
Makes an XY curve appear to grow. anim_xysweep.mcr
Animates zones so that one or more zones remain active throughout. anim_1active.mcr
Animates two sets of zones loaded to same frame. It activates the first zone of each set, then the second zone of each set, etc. anim_2sets.mcr
Animates zones where n consecutive zones are active throughout the animation. anim_n_adj.mcr
Animates the contents of multiple frames simultaneously. Frames can contain zones or XY maps. anim_n_frames.mcr
Same as the “Animate IJK Planes” feature under the Tools/Animate menu, except only 1 IJK-ordered zone is animated. animijk_alt.mcr
For a 3D i-ordered data set, points will be displayed singly, from first to last, with the index value displayed on each. Each point will be colored according to the value of a 4th variable. anim_point.mcr
Calculates the total area of all cells which lie above a specified contour variable limit. area.mcr
Creates a new variable that is set to the AVERAGE of a chosen variable. This AVERAGE is calculated for all of the points in the lowest ACTIVE zone in your dataset. This macro only works on I-, IJ-, and IJK-ordered data. average.mcr
Calculates the difference between 2 i-ordered XY curves (zones) with different numbers of points. diff_sum_2zones.mcr
Integrates the volume below an IJ ordered surface in 2D mode, given a contour variable. ijint.mcr
Calculates the area below an XY curve. integrate.mcr
Macro to create a plot where scatter symbols are drawn on top of a contour plot where the scatter symbols represent the positions of the minimum and maximum contour value. markminmax.mcr
Copys a zone multiple times and rotate the duplicates around an XY point. Great for making propellers, turbines, etc. from a single blade. pinwheel.mcr
Switches the I and J indices of an IJ-ordered zone. switchij.mcr
Creates a variable which is used to number the zones. zonenum.mcr
Splits an I ordered zone into smaller zones based on the values of one of the variables. zone_spiltbyvar.mcr
Splits an I ordered zone into smaller zones, based on a user provided number of points for each smaller zone. zone_splitbynum.mcr

Quick Macro Panel (QMP) Files

These files contain one or more macro functions that can be added to the Quick Macro Panel found in your Tecplot software. As the name implies, this panel gives you quick access to your favorite, commonly used macro functions. To use them, open the file with a text editor, then copy and paste the functions to the tecplot.mcr file located in your Tecplot home directory.

What the QMP File does Click filename to download
A series of functions that set the value blanking to blank all cells outside of the current axis range. (2D or 3D). clip2axis.mcr
Macro functions to allow you to IJK-Blank multiple zones. This uses value blanking to simulate IJK-Blanking. ijkblank.mcr
Macro functions for creating north arrow or scale bar for map plots. mapsymbols.mcr
A macrofunction that can do a Probe At on a 2d dataset. probe2D.mcr
A macrofunction that can do a Probe At on a 3d dataset. probe3D.mcr

Macro FAQs

Q: How do I export an image when I have hundreds of zones?

If you have hundreds of zones it can be time consuming to switch to each zone and export an image.  Macros can be used here to automatically activate each zone in succession and export an image.

  1. Scripting > Record Macro,
  2. Activate a zone,
  3. Export image
  4. Stop recording.

Then edit the macro file using a text editor and encase the export and activate call in a LOOP and ENDLOOP.  

For more information about macros, see our documentation Scripting Guide.

Q: Are macros and add-ons compatible with all version of Tecplot 360?

Newer versions of Tecplot 360 are backwards compatible with earlier versions of Tecplot 360.

  • TecIO files are compatible with all versions of Tecplot 360.
  • Add-ons will have to be recompiled. They are source compatible, but the libraries will need to be updated.
  • Existing Macros are compatible with earlier Tecplot 360 versions. However, Macros created with Tecplot 360 2014 and later are not backwards compatible with earlier versions.