CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] NameError: name 'LegacyVTKReader' is not defined

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2013, 08:54
Default NameError: name 'LegacyVTKReader' is not defined
  #1
Senior Member
 
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 13
Eloise is on a distinguished road
Hello,

I'm trying to run a very simple python script with Paraview 4.0.1 64 bit and I get the error message
NameError: name 'LegacyVTKReader' is not defined

The script is :
Code:
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

solid_vtk = LegacyVTKReader( FileNames=['D:\\PostProcessing\\solid.vtk'] )
Render()
To run it, I open the Python shell in Paraview and press "Run Script" button.

Can someone test it? Maybe I'm not importing the paraview commands properly? Any advice is welcome

Also: If I type solid_vtk = LegacyVTKReader( FileNames=['D:\\PostProcessing\\solid.vtk'] ) in the python shell, it works... But I'd like to use a rather complex script which I can't type in the shell....

Eloïse
Eloise is offline   Reply With Quote

Old   September 28, 2013, 12:24
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Eloïse,

Unfortunately not all macros generated by the Trace feature in ParaView will work out-of-the-box. Try this script instead:
Code:
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

solid_vtk = LegacyVTKReader( FileNames=['D:\\PostProcessing\\solid.vtk'] )
Render()
Although... it's weird... because at first it didn't work as well, but after a couple of tries with the original code, it works fine. Perhaps it has a few issues with expecting that the base Python code to be already in memory!?

Best regards,
Bruno
nisha and kiddmax like this.
__________________
wyldckat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] How can I define different zones in ICEM? llrr ANSYS Meshing & Geometry 14 February 12, 2017 13:44
UDF link fortran source yorelchr Fluent UDF and Scheme Programming 0 February 7, 2013 03:44
using METIS functions in fortran dokeun Main CFD Forum 7 January 29, 2013 04:06
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
OpenFOAM13 for Mac OSX Darwin 104 hjasak OpenFOAM Installation 70 September 24, 2010 05:06


All times are GMT -4. The time now is 06:00.