**tecplot 2019R1 pytecplot 用不了的问题(tecplot GUI能用但是pytecplot不能用)**
1遇到的问题
我安装了tecplot 2019R1,tecplot GUI 可以正常使用,点击了 accept pytecplot connection(port:7600)
运行程序提示没有license
于是在程序中添加了关键语句:tp.session.connect(port=7600)
2解决关键
在程序中添加了关键语句:tp.session.connect(port=7600)
3实例(Hello Wold图片输出)
3.1官方教程hello world
https://www.tecplot.com/docs/pytecplot/examples.html#hello-world
程序如下:
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)
但是我的会提示license没有得到许可,需要联系技术支持
3.2改变程序
import sys
#import logging
#logging.basicConfig(level=logging.DEBUG)
from os import path
import tecplot as tp
from tecplot.constant import *
tp.session.connect(port=7600)
tp.new_layout()
frame=tp.active_frame()
frame.add_text('hello world!',position=(36,50),size=34)
tp.export.save_png('hello.png',600,supersample=3)
成功输出hello.png,如果找不到位置,在文件管理器里头搜一下