« Back

PyTecplot for Tecplot Scripting

Paul Ferlemann is an aeronautical engineer and researcher at the Hypersonic Airbreathing Propulsion Branch (HAPB) of the NASA Langley Research Center. The HAPB performs research to develop advanced technology for hypersonic airbreathing propulsion systems for aerospace vehicles. The focus is on airframe-integrated engine concepts having high performance over a wide range of flight Mach numbers.

The Challenge

Paul was working with a complex geometry composed of 112 distinct zones. The desire was to show only exposed edges. For structured data, specifying which edges of each zone to display can be done by adjusting border styles in Tecplot 360. The challenge comes in knowing which borders to show for each zone. Manually adjusting the style for 112 zones would be tedious, error prone and time consuming – not to mention that this process must be repeatable for various geometries, many of which are far more complex, having easily 1000s of zones.

Edge Detection

Figure 1: All edges displayed (left). Only exposed edges displayed (right)

A Solution

Paul chose to use the Tecplot 360 macro language to automate this task using an edge detection algorithm. Then using the algorithm results, the macro adjusted the edge border settings for each zone to achieve the desired result. While this solution worked, the Tecplot 360 macro language is not optimized for the data access required to determine shared edges. As a result, the script was over 800 lines, was difficult to author and debug, and took 18 minutes to run on this relatively small geometry.

Says Paul “At the time (2011), using the Tecplot 360 macro language to automatically set border styles to only display exposed edges was the only option and seemed fairly straight-forward, at least conceptually. While the macro did save “human” time (typically executed before lunch or even over night for a large case), it was frustrating that it could not be efficiently used interactively.”

The PyTecplot Solution

Engineers at Tecplot rewrote Paul’s edge detection algorithm using PyTecplot, a Python API in Tecplot 360 2017 and later releases. Python is a compact and expressive language, and as a result the final script was less than 200 lines of code and executes in only 7.3 seconds!
Again, Paul: “The time savings demonstrated for the same algorithm implemented by engineers at Tecplot using PyTecplot is very dramatic. I look forward to using PyTecplot for Tecplot scripting projects in the future.”


Compared to the Tecplot macro language, PyTecplot is easier to author, easier to debug, and faster to execute. PyTecplot is available to Tecplot 360 licensees with a TecPLUS subscription. Watch the introductory video and read through the documentation on PyTecplot.

Learn about PyTecplot »

Try Tecplot 360 for free