File tree Expand file tree Collapse file tree 2 files changed +43
-27
lines changed Expand file tree Collapse file tree 2 files changed +43
-27
lines changed Original file line number Diff line number Diff line change 1+ import sys
2+
3+ import numpy as np
4+
5+ import tecplot as tp
6+ from tecplot .exception import *
7+ from tecplot .constant import *
8+
9+ # if "-c" is passed as an argument from the
10+ # console conntect to Tecplot 360 on the
11+ # default port (7600) and clear the layout
12+ if '-c' in sys .argv :
13+ tp .session .connect ()
14+ tp .new_layout ()
15+
16+ # load a single data file
17+ infile = 'hotwatermixing/HotWaterMixing.plt'
18+ dataset = tp .data .load_tecplot (infile )
19+
20+ # get handle to the 3D plot in the active frame
21+ plot = tp .active_frame ().plot (PlotType .Cartesian3D )
22+
23+ # turn off shade
24+ plot .show_shade = False
25+
26+ # turn on slices
27+ plot .show_slices = True
28+
29+ # get the contour group from the slice group
30+ contour = plot .slice (0 ).contour .flood_contour_group
31+
32+ # set contour variable
33+ contour .variable = dataset .variable ('Temperature' )
34+
35+ # adjust legend properties
36+ contour .legend .auto_resize = True
37+
38+ # set contour levels
39+ contour .levels .reset_levels (np .linspace (280 , 380 , 201 ))
40+
41+ # save image of slice through pipe
42+ tp .save_png ('hotwater-slice.png' )
43+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments