[Paraview] Python Shell, Scripting data input

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Dec 14 09:51:54 EST 2007


Alexander,

Every proxy needs to know which server connection it is to be created on 
(it may be the connection to the builtin server). This is a moot point 
currently since ParaView supports only one server at a time, however it 
provides for future possibilities. Now, when you create a proxy using 
NewProxy, the connection id needs to be set on the proxy. This can be 
done as:

readerP = pm.NewProxy("sources", "ensight");
readerP.SetConnectionID(servermanager.ActiveConnection.ID)

alternatively, you can use the recommended API for creating proxies via 
python i.e.

readerP = servermanager.sources.ensight()

This should set the connection id correctly.

Now coming back to your use-case. In case where you have  fixed pipeline 
that you want to use over and over again, we now have what we call 
"Custom Filters". It's a composite filter consisting of a subpipeline. 
One can expose certain parameters from the internal filters which the 
user can explicitly change on each application of the filter. This 
functionality is under development and currently available in the CVS 
version.

Utkarsh

Alexander Wille wrote:
> Hello everyone,
> 
> I regularly apply the same set of filters with very slight parameter modifications to similar data sets of the ever same format. Everytime I have to build about the same filter pipeline. I would like to automate that using the Python Shell. I would like to load a script into the python shell which does all these steps for me. I already have a script which adds and configures all the filters, but I still have to open the data files manually, because:
> 
> # My Python Code:
> # - Loading EnSight Data -
> pm = servermanager.ProxyManager()
> readerP = pm.NewProxy("sources","ensight")
> readerP.GetProperty("CaseFileName").SetElement(0, "SomeEnsightCaseFile.case")
> readerP.UpdateVTKObjects()
> pm.RegisterProxy("sources","fluid",readerP) # THIS METHOD FAILS, stating "Failed to locate server for newly registered proxy ("sources", "fluid")"
> # - Filter configuration -
> # ...
> 
> Does anyone have an idea what causes this error and how it could be solved? Any suggestions would be appreciated!
> 
> 
> Cheers,
> Alexander Wille
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list