Hi once again,

I still haven't achieve to open the *.vtk file with a python script. I tried 
mainly two different ways:

1. Has you said, with the OpenDataFile command. But I get the error below, as 
it 
could not read *.vtk file.

#Python script
from paraview.simple import *
reader = OpenDataFile("C:/Documents and 
Settings/Nit@/Escritorio/pet/out1-1.vtk")
Show(reader)
Render()
##########

#error on the python shell
Traceback (most recent call last): 
File "<string>", line 2, in <module>
File "C:\Archivos de programa\ParaView 
3.8.0\lib\paraview-3.8\paraview\simple.py", line 115, in OpenDataFile
reader = globals()[xml_name](FileName=filename, **extraArgs)
File "C:\Archivos de programa\ParaView 
3.8.0\lib\paraview-3.8\paraview\simple.py", line 542, in CreateObject
setattr(px, param, params[param])
File "C:\Archivos de programa\ParaView 
3.8.0\lib\paraview-3.8\paraview\servermanager.py", line 201, in __setattr__
"to add this attribute.")
AttributeError: Attribute FileName does not exist.  This class does not allow 
addition of new attributes to avoid mistakes due to typos. Use add_attribute() 
if you really want to add this attribute.##########

Do someone know what should I change or what 's wrong?

2. I searched for a specific vtk reader and I found in internet 
(https://visualization.hpc.mil/wiki/VTK_in_Python) the following solution and 
getting the following error:

#python script
from vtk import *;
reader = vtkDataSetReader()
reader.SetFileName("out1-1.vtk")
Show(reader4)
Render()
###########

#error on the python shell
Traceback (most recent call last): 
File "<string>", line 1, in <module>
ImportError: No module named vtk
###########

I download the vtk source http://www.vtk.org/VTK/resources/software.html and 
installed the latest verion for Windows. If I had not understood bad I made 
what 
was necessary (https://visualization.hpc.mil/wiki/Getting_Started_with_VTK).
But still doesn't recognize the vtk library. Does someone know what's wrong? or 
how paraview could recognize the vtk library?

Thanks you for advance and sorry for the inconviniences. 

Llapis


      
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to