Adding a PyTecplot Script to the Quick Macro Panel

Problem: Can I play a PyTecplot script from the Quick Macro Panel (QMP) in Tecplot? Solution: Yes! This procedure describes how to add a PyTecplot script to your QMP using the Histogram.py (found in the python handy scripts of our GitHub): 1) Make sure PyTecplot is installed and updated, along with other modules used in your PyTecplot script (such as numpy). It is also recommended that you install the latest version of Tecplot […]

» Read More


Running a Recorded PyTecplot Script Gives Error

Problem: When I run my PyTecplot Python script, I receive a TypeError, ValueError, KeyError, or AttributeError. However, I recorded this script from the 360 user interface, or wrote it using the current Pytecplot documentation, so it should be correct. What is causing this error? For example, running a recorded script using plot.fieldmaps(6,7,8,9,10,11) with PyTecplot 1.0 gives the following error: Traceback (most recent call last): File “C:\recorded_pytecplot.py”, line 17, in <module> tp.active_frame().plot().fieldmaps(6,7,8,9,10,11).mesh.show=False TypeError: […]

» Read More


PyTecplot TecplotLibraryNotFoundError Using Python 3.8+

Problem: In batch mode, when I run my PyTecplot script using Python 3.8+ on Windows, I receive an error stating that: tecplot.exception.TecplotLibraryNotFoundError: The Tecplot batch library or one of its dependencies could not be found… What is causing this error? Solution: It is likely that you are using an out-of-date version of PyTecplot. Using PyTecplot in batch mode with Python 3.8 on Windows 10 requires version 1.1 or later. Python […]

» Read More


Display Solution Time on Plot

Problem: I want to display the solution time on my plot.   Solution: Use dynamic text to refer to Tecplot’s SOLUTIONTIME variable. Navigate to the Insert>Text menu and click on the plot to open the Text Details dialog. Refer to the SOLUTIONTIME variable using the following syntax: &(SOLUTIONTIME) Please see the User’s Manual for a list of available options regarding dynamic text formatting. For example, to format the solution time […]

» Read More


Clip Plane

Problem: I want to perform a clip plane.   Solution: Use a set of macro commands to clip above/below the defined slice.   The macro command related to the clipping of planes is: $!SliceAttributes 1 ClipPlane. It can take the following arguments: AbovePrimarySlice, BelowPrimarySlice, and None. Consider adding these macros to your Quick Macro Panel  for faster access: $!MacroFunction NAME = “Clip above primary slice” ShowInMacroPanel = TRUE $!SliceAttributes 1 ClipPlane […]

» Read More


Convert Solution Time Format for Display

Problem: My solution time is in seconds (ssss.ss), and I want to display it as hours:minutes:seconds (hh:mm:ss.ss). Solution: Use a Tecplot macro to loop over time and retrieve the solution time. Assign the hours, minutes, and seconds to new variables and refer to their max values using dynamic text.   Macro Procedure (see link to the GitHub script below): Retrieve the number of time steps: $!EXTENDEDCOMMAND COMMANDPROCESSORID=’extend time mcr’ COMMAND=’QUERY.NUMTIMESTEPS […]

» Read More


Extract Boundary Layer Values

This article describes both a macro and a PyTecplot script that extracts a field variable along a line normal to a surface. We recommend using PyTecplot insofar as possible. Example: Load the M6-Wing example file, which can be found in your Tecplot Installation Directory: …/Tecplot/Tecplot 360 EX 20xx R1/examples/OneraM6wing/OneraM6_SU2_RANS.plt. To better visualize the node at which we’ll probe, let’s turn on the mesh for the second zone. Zoom somewhere on […]

» Read More


Offsetting an Axis in 3D Cartesian Mode

Problem: I am displaying one axis in my 3D plot, but my data interferes with it (see Figure 1). How do I offset my axis away from my plot? Solution: Change the minimum value of the vertical axis range in that view. In the case of Figure 1, the Z axis range minimum needs to be decreased. For this example, 1) Go to Plot>Axis… and select the Z axis and […]

» Read More


Displaying Data Labels at High Magnification

Question: At high magnification, my cell and point labels become grainy and look terrible. How can I display these labels correctly? Solution: Use software rather than hardware rendering to display these node labels on a highly zoomed plot. See Figure 2. 1)  Download software_hardware_rendering_qmp.mcr  from our GitHub or create a macro with this code: #!MC 1200 $!MacroFunction Name = “SwitchToSoftwareRendering” SHOWINMACROPANEL = true $!Page UseSoftwareRendering = true $!EndMacroFunction $!MacroFunction Name […]

» Read More


PyTecplot Link Between Frames

In the release of PyTecplot 1.0, Frame Linking has been implemented in the API. Frame Linking allows users to quickly link attributes of frames together like position, 3D view, and solution time. To link the view simply implement the following commands on both frames: for frame in tp.frames(): plot = frame.plot(PlotType.Cartesian3D) plot.activate() frame_linking = plot.linking_between_frames frame_linking.group = 1 frame_linking.link_view = True frame_linking.link_solution_time = True This allows all of the frames […]

» Read More