[vtkusers] vtkAppendPolyData woes

Gerard Gorman g.gorman at imperial.ac.uk
Sat Aug 9 08:08:35 EDT 2003


Prabhu Ramachandran wrote:
> Perhaps adding an appendF.Update() before you get the output will
> help.

I'm afraid that it made no difference (see the change below). For the 
curious I put two example polydata files in at:
http://amcg.ese.ic.ac.uk/~gormo/sampleVTKFiles/tracers80.vtp
http://amcg.ese.ic.ac.uk/~gormo/sampleVTKFiles/tracers81.vtp
...so just use the below script as
./test.py tracers80.vtp tracers80.vtp

Cheers
Gerard.

#!/usr/bin/env python2
import vtk,sys

file0 = sys.argv[1]
file1 = sys.argv[2]

appendF = vtk.vtkAppendPolyData ()

r0 = vtk.vtkXMLPolyDataReader ()
r0.SetFileName (file0)
r0.Update ()
appendF.AddInput (r0.GetOutput ())
# object looks file here
print appendF.GetInput (0)

r1 = vtk.vtkXMLPolyDataReader ()
r1.SetFileName (file1)
r1.Update ()
appendF.AddInput (r1.GetOutput ())
# object looks file here
print appendF.GetInput (1)

appendF.Update ()

# here I get nothing
print appendF.GetOutput ()

#and checking the file I have definatly nothing
w = vtk.vtkXMLPolyDataWriter ()
w.SetInput (appendF.GetOutput ())
w.SetFileName ("appendtest.vtp")
w.Write()




More information about the vtkusers mailing list