CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

NameError: name 'LegacyVTKReader' is not defined

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools 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: 103
Rep Power: 4
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,253
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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

Thread Tools
Display Modes

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 On
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 13 August 4, 2014 20:04
UDF link fortran source yorelchr Fluent UDF and Scheme Programming 0 February 7, 2013 04:44
using METIS functions in fortran dokeun Main CFD Forum 7 January 29, 2013 05: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 08:21.