How to Reset the Light Source Position

Problem: I have changed the position of the light source interactively using the mouse. There’s no UI option to reset the light source to its original position. How can I do this? Solution: Use a macro command to reset the light source position: #!MC 1410 $!GLOBALTHREED LIGHTSOURCE { XYZDIRECTION { X = -0.2 Y = -0.2 Z = 0.959 } }


Customize the Color Palette

Problem: I want to change the default colors of the palette. Solution: Call a macro at Tecplot’s startup to overwrite the default colors in the palette.   To do so: Edit the tecplot.cfg file in Tecplot’s installation directory and include a set of $!BASICCOLOR macro commands to change the palette. In the palette, each color placeholder is referd to as CUSTOM#, where # is the placeholder number in the palette. […]

» Read More


Min-Max Values of Transient Data

Problem: The min-max values shown in the Data Set Information dialog do not show values across all time. Solution: If you have transient data, the min-max for a variable is only for the “active zones” which unfortunately means only the current time step because the other time steps are not currently active. To see the min-max for the entire data set, run the PlotMinMaxContourOverTime.mcr macro from the Tecplot handyscripts GitHub […]

» Read More


Deleting Geometries in a Layout Template

Question: How does one replace the geometries (shapes, polylines, etc.) already present in a layout when a new data file is loaded into the layout file? Explanation of the Question: I created a layout file from a dataset that contains geometries, such as a relative wind velocity vector or aircraft body axes relative to wind axes. I want to create a template from this layout, but the geometries are now […]

» Read More


Adding Macros to the Quick Macro Panel

In Tecplot 360, the Quick Macro Panel is a sidebar for playing your favorite or frequently-used macros. It initially appears docked to the right side of the main Tecplot 360 window, but like the other sidebars can be hidden from view. To display the Quick Macro Panel, select Scripting->Quick Macros. Adding macros to the Quick Macro Panel in Tecplot 360 is useful for playing your favorite or frequently-used macros. The […]

» Read More


Calculate Swirl Strength

Problem: How do I calculate the Swirling Strength criterion (Lambda-Ci)? Solution: Use a Tecplot Macro to automate the calculation. Make sure Tecplot is aware of the variables representing your velocity field (Analyze->Field Variables menu).   The commands are as follow: Calculate the tensor of velocity gradients. This command can be obtained by recording the Analyze->Calculate Variables…->Velocity Gradient (tensor) action in Tecplot’s user interface (UI). $!EXTENDEDCOMMAND COMMANDPROCESSORID = ‘CFDAnalyzer4’ COMMAND = […]

» Read More


Calling a Macro from Another Macro

Problem: I have a few macros that I use often and want to call them from within another macro. Solution: Tecplot 360 allows for macros and macro functions to be called from other macro files via the $!INCLUDEMACRO command. For example, if you have a macro function to post an equation in a file called add_text.mcr: #!MC 1410 $!MACROFUNCTION NAME = “Equation” $!AttachText AnchorPos { X = 10 Y = […]

» Read More


Calculate Delta Criterion

Problem: How do I calculate Delta Criterion? Solution: The easiest way to do this is to use a Tecplot Macro to automate the calculation. Calculations are derived from http://www.ctr.maths.lu.se/media/thesis/2013/FMA820.pdf First, make sure Tecplot has established the velocity variables via the Field Variables dialog (Analyze -> Field Variables). Then, play the macro via the Scripting menu. The macro commands are as follows: Calculate the Velocity Gradient tensor. (Can also be calculated […]

» Read More


Use Raw Strings to Load Multiple Files Using Multiple Lines

In 2018 R2 we’ve added the capability for raw strings to be used in Macros. This added the capability to space the files out on multiple lines for readability. Before raw strings, all of the files had to be placed on one line which made for terrible readability when loading more than a couple of data files. Here is the syntax for loading multiple files: $!ReadDataSet R”INPUTFILES(“/this/is/a/somewhat/long/file/name/File1.dat”                                                                 “/this/is/a/somewhat/long/file/name/File2.dat”                                                                 […]

» Read More


Calculate Lambda-2 Criterion

Problem: How do I calculate the Lambda-2 criterion? Solution: Use a Tecplot Macro to automate the calculation. Make sure Tecplot is aware of the variables representing your velocity field (Analyze->Field Variables menu).   The commands are as follow: Calculate the tensor of velocity gradients. This command can be obtained by recording the Analyze->Calculate Variables…->Velocity Gradient (tensor) action in Tecplot’s graphical user interface (GUI). $!EXTENDEDCOMMAND COMMANDPROCESSORID = ‘CFDAnalyzer4’ COMMAND = ‘Calculate […]

» Read More