[Paraview] Re: Python Shell, Scripting data input

Fabian Braennstroem f.braennstroem at gmx.de
Fri Dec 14 16:07:18 EST 2007


Hi Alexander,

it would be nice, if you share your python script. I am
badly looking for python examples for the newest 3.2.1
version :-)

Regards!
Fabian
Utkarsh Ayachit schrieb am 12/14/2007 02:51 PM:
> 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
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list