[Paraview] load plugin through python scripts

曹智选 hitcaozx at gmail.com
Fri Aug 12 17:15:37 EDT 2016


The problem is still not solved.
I added ns=globals() and tried both remote=False and remote=True. Neither
of them works. The same error message persist: Plot[plotname] =
H5PartReader(FileName=maindirectory+subdirectory+name)
NameError: global name 'H5PartReader' is not defined

2) I also tried to replace H5PartReader  with
servermanager.sources.H5PartReader.
It still does not work. This time, there is no error message but the data
was not load successfully and there is some “Output Message”:

Some proxy is added as input but was not registered with Proxy Manager.
This is not recommended.



2016-08-11 18:10 GMT-04:00 曹智选 <hitcaozx at gmail.com>:

> Hi,
> I am trying to write a python scripts to "visualize" simulation results.
>
> I need load a plugin through GUI of paraview before opening data. If I
> first load plugin in the GUI and then run my python scripts through
> Paraview GUI -> tools ->python shell, it works well.
> To load plugin in python scrips. I use the trace tool of paraview found
> that the function to load plugin is:
> LoadPlugin('/rohit1/data/users/zhixuanc/Soft/ParaView-
> 4.3.1-Linux-64bit/lib/paraview-4.3/libH5PartReader.so', remote=False).
>
> Instead of load plugin manually through GUI, I put this command at the
> very beginning of the existing python scripts and run the scripts through
> Paraview GUI -> tools ->python shell. But I got an error message and it
> does not work:
>
> Plot[plotname] = H5PartReader(FileName=maindirectory+subdirectory+name)
>
> NameError: global name 'H5PartReader' is not defined
>
> But when I go to Paraview GUI -> tools -> Manage Plugins, it shows that
> the required plugin is loaded.
>
> I am not sure what's wrong and how to fix this issue.
>
> Could anybody give me any advice on it?
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160812/8903f12a/attachment.html>


More information about the ParaView mailing list