This video introduces and details the benefits PyTecplot library.
PyTecplot is our new Python API that uses the Tecplot 360 data and rendering engine. The PyTecplot library is a high level API that connects your Python script to the power of the Tecplot 360 visualization engine.
Compared to the existing Tecplot 360 macro language, PyTecplot is faster, allows direct data access and manipulation and resolves shortcomings of the macro language such as string processing, logical operators and loops.
In a specific use case, a customer wanted to turn off borders at shared edges. They used the Tecplot macro language to create an edge detection algorithm. This macro required 846 lines of code and took 18 minutes to run. We worked with this customer to demonstrate the same procedure with PyTecplot. The resulting script required 201 lines of code and only 7.3 seconds to run.
PyTecplot clearly offers some significant performance advantages over the Tecplot macro language.
Documentation for PyTecplot can be found in the doc folder of your Tecplot 360 installation, and on our website. PyTecplot requires Tecplot 360 2017 R1 or later and a 64-bit installation of Python. You can install PyTecplot by running pip install pytecplot from a terminal or command line window.
Once installed, PyTecplot can be tested by running any of the example scripts and viewing the result.
This specific script opens an existing layout, calculates the difference between 2 time steps and exports the resulting frames. Notice how the script also uses embedded macro commands, a capability of PyTecplot that is useful for users transitioning from the Tecplot macro language.
Now that the script has finished running, the resulting images appear in the directory.
Thanks for watching!
Try Tecplot 360 for free