[Paraview] Fwd: 'UnstructuredGridReader' is not defined

David López dysmarbella at gmail.com
Fri Feb 14 12:19:54 EST 2014


---------- Forwarded message ----------
From: David López <dysmarbella at gmail.com>
Date: 2014-02-14 18:17 GMT+01:00
Subject: Re: [Paraview] 'UnstructuredGridReader' is not defined
To: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>


Hello Utkarsh, the problem was that i needed to put " paraview.simple." in
all functions i used.

try: paraview.simple
except: from paraview.simple import *
import sys

path = "c:/temp/prueba/"
fichero_vtu = 'groupvtu_1.vtu'
sys.path.append(path)
paraview.simple._DisableFirstRenderCameraReset()
GRUPO_vtu = paraview.simple.XMLUnstructuredGridReader( FileName=[path +
fichero_vtu] )
GRUPO_vtu.PointArrayStatus = []
GRUPO_vtu.CellArrayStatus = []
GRUPO_VTU = paraview.simple.GetActiveSource()
paraview.simple.RenameSource("MODEL", GRUPO_vtu)

MODEL = GRUPO_VTU
del GRUPO_VTU
paraview.simple.Render()


paraview.simple.XMLUnstructuredGridReader()      instead
XMLUnstructuredGridReader()
paraview.simple.GetActiveSource()                          instead
GetActiveSource()
paraview.simple.RenameSource()                            instead
.RenameSource()
paraview.simple.Render()
    instead       paraview.simple.Render()

Many thanks for your help.


2014-02-14 15:48 GMT+01:00 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>:

Try using OpenDataFile
> (
> http://www.paraview.org/ParaView3/Doc/Nightly/www/py-doc/paraview.simple.html#paraview.simple.OpenDataFile
> ).
> Does that work?
>
> Utkarsh
>
> On Fri, Feb 14, 2014 at 7:33 AM, David López <dysmarbella at gmail.com>
> wrote:
> > Hello, i´m trying to open a vtu file via python:
> >
> > try: paraview.simple
> > except: from paraview.simple import *
> > import sys
> > path = "c:/temp/prueba/"
> > fichero_vtu = 'groupvtu_1.vtu'
> >
> > sys.path.append(path)
> > paraview.simple._DisableFirstRenderCameraReset()
> > GRUPO_vtu = XMLUnstructuredGridReader( FileName=[path + fichero_vtu] )
> > GRUPO_vtu.PointArrayStatus = []
> > GRUPO_vtu.CellArrayStatus = []
> > GRUPO_VTU = GetActiveSource()
> > RenameSource("MODEL", GRUPO_vtu)
> > MODEL = GRUPO_VTU
> > del GRUPO_VTU
> > Render()
> >
> > This Works fine in Paraview 3.98.1 but y get this error on Paraview 4.0.1
> >  File "<string>", line 12, in <module>
> >
> > NameError: name 'UnstructuredGridReader' is not defined
> >
> >
> > I need help, thanks.
> >
> > _______________________________________________
> > 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20140214/128de6e4/attachment.html>


More information about the ParaView mailing list