Difference between revisions of "ParaView/Automation with Python"
From PHASTA Wiki
Line 1: | Line 1: | ||
1. Extract surface using paraview, the code will look like | 1. Extract surface using paraview, the code will look like | ||
− | + | from paraview.simple import * | |
− | #========== read in data file | + | /#========== read in data file |
print 'Read phasta file' | print 'Read phasta file' | ||
Line 16: | Line 16: | ||
vtkWriter.UpdatePipeline() | vtkWriter.UpdatePipeline() | ||
− |
Revision as of 13:59, 26 July 2012
1. Extract surface using paraview, the code will look like
from paraview.simple import *
/#========== read in data file
print 'Read phasta file'
dataObj = PhastaReader( FileName= 'restart_one.pht' )
SRF = ExtractSurface(Input=dataObj)
MGBLK1 = MergeBlocks(Input=SRF)
vtkWriter = DataSetWriter(FileName = 'Surface.vtk' , Input = MGBLK1, FileType = 1)
vtkWriter.UpdatePipeline()