调用代码
- 确保tecplot连接好(7600);
- pycharm运行。
运行相关调用代码
import logging
logging.basicConfig(level=logging.DEBUG)
import tecplot
# Run this script with "-c" to connect to Tecplot 360 on port 7600
# To enable connections in Tecplot 360, click on:
# "Scripting" -> "PyTecplot Connections..." -> "Accept connections"
import sys
if '-c' in sys.argv:
tecplot.session.connect()
tecplot.new_layout()
frame = tecplot.active_frame()
frame.add_text('Hello, World!', position=(36, 50), size=34)
tecplot.export.save_png('hello_world.png', 600, supersample=3)
即可保存“hello everyone”的图像。
实现在tecplot上显示(交互运行):
- 在tecolot中打开pytecplot connectted
- 在terminal中输入“python 文件名.py -c”