There was a bug in OpenDataFile() that was fixed a few days ago (May 26) that is causing that "AttributeError: Attribute FileName does not exist". Attached is a patch for the same.
Utkarsh 2010/6/4 Berk Geveci <[email protected]>: >> 1) reading : >> ------------ >> >> from a vtkStructuredGrid object, I use a vtkStructuredGridWriter to create a >> vtk file, and I have the following problem : >> when I launch the script in Paraview, the format of floating points is not >> good (I obtain for example 33,1632 instead of 33.1632). So, the file created >> is not readable by Paraview. If I launch the script directly in a terminal, >> it works fine. Perhaps because the version of vtk module is not the same ? >> If I use the binary format I have not this problem. > > This seems to be related to the way the LOCALE is set on your system. It is > probably set to French in one case and English in the other. Does anybody know > if we can force LOCALE to English in the ParaView application or the reader? > >> 2) writing : >> ------------ >> >> I would like to read my vtk files from the python shell, with >> OpenDataFile(), but It didn't succeed and I have the following message (with >> a file which can be read in paraview using menu open of course :-) : > > Unless I am mistaken, you give the filename directly to OpenDataFile(), > without FileName=. > > -berk > >> >> >> /home/plumecoq/tmp/ParaView/flow_1_0075.vtk >> Traceback (most recent call last): >> File "<string>", line 1, in <module> >> File "/home/plumecoq/EHPOC/plugins/ElsaMenu/elsa.py", line 91, in <module> >> main() >> File "/home/plumecoq/EHPOC/plugins/ElsaMenu/elsa.py", line 73, in main >> reader_vtk = OpenDataFile(file_name_vtk) >> File >> "/home/plumecoq/Paraview/ParaView-3.8.0-bin/Utilities/VTKPythonWrapping/paraview/simple.py", >> line 115, in OpenDataFile >> reader = globals()[xml_name](FileName=filename, **extraArgs) >> File >> "/home/plumecoq/Paraview/ParaView-3.8.0-bin/Utilities/VTKPythonWrapping/paraview/simple.py", >> line 542, in CreateObject >> setattr(px, param, params[param]) >> File >> "/home/plumecoq/Paraview/ParaView-3.8.0-bin/Utilities/VTKPythonWrapping/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. >> >> >> any ideas ? I try to use LegacyVTKFileReader instead, but I have also some >> problems. >> >> I use a re-compile version of Paraview 3.8, under Linux (Fedora 10 - 64 >> bits) >> >> thanks for your help. >> >> Jérôme >> >> _______________________________________________ >> 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 >> >> > _______________________________________________ > 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 >
commit d6a34c90f40dee39f1ca0148c71a7038c34feaaf Author: Utkarsh Ayachit <[email protected]> Date: Wed May 26 15:27:24 2010 -0400 Fixed error when opening blow.vtk. diff --git a/Utilities/VTKPythonWrapping/paraview/simple.py b/Utilities/VTKPythonWrapping/paraview/simple.py index c666f66..b5545da 100644 --- a/Utilities/VTKPythonWrapping/paraview/simple.py +++ b/Utilities/VTKPythonWrapping/paraview/simple.py @@ -112,7 +112,10 @@ def OpenDataFile(filename, **extraArgs): prototype = servermanager.ProxyManager().GetPrototypeProxy( reader_factor.GetReaderGroup(), reader_factor.GetReaderName()) xml_name = paraview.make_name_valid(prototype.GetXMLLabel()) - reader = globals()[xml_name](FileName=filename, **extraArgs) + if prototype.GetProperty("FileNames"): + reader = globals()[xml_name](FileNames=filename, **extraArgs) + else : + reader = globals()[xml_name](FileName=filename, **extraArgs) return reader def GetRenderView():
_______________________________________________ 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
