[Paraview] Connection to a server from python / C++

Weirs, V Gregory vgweirs at sandia.gov
Fri Feb 22 11:56:36 EST 2008


The link you have describes the python api for early paraview 3, if you are using paraview 3.2 or later, get the pdf document on the servermanager near the top of the page you referenced. In that doc, it will describe a newer python interface to paraview. Your commands will look like

from paraview import servermanager
connection = servermanager.Connect()

Your first sentence is a little unclear. If you want to use the python scripting from pvpython, do the above; if you want to do it from the python shell in the ParaView Client, you should already have a connection to the builtin server.

Greg


On 2/21/08 6:15 PM, "Jefferson Thomas" <foramuyou at gmail.com> wrote:

I want to connect to a ParaView server from the ParaView client using python. Im using Paraview 3.2.1. Following the procedure found on http://www.paraview.org/Wiki/ParaView:pvpython Im using the code:

import paraview
connection=paraview.Connect()
paraview.ActiveConnection=connection

The connection works but it has no name. Also the previous connection doesnt disappear and now I have two 3D displays. But the strange thing is that when I delete manually the first (the one that was there before, the "builtin") connection (clicking on it and chosing "Delete") then the connection I created, the new one, suddenly becomes useless - when I try to open the File->Open dialog or add a new source an error comes up saying "No active server selected" !
The same thing happens when using a c++ plugin with a code:

vtkProcessModule *promod=vtkProcessModule::GetProcessModule();
promod->ConnectToRemote("localhost",port);

The best would be if the state after connection was like the state you get after clicking the Connect button in ParaView GUI - the previous connection disappears and the new one has a name.
How can I do it from inside the C++ code/python ?






--
V. Gregory Weirs
Sandia National Laboratories                vgweirs at sandia.gov
P.O.Box 5800, MS 0378                        phone: 505 845 2032
Albuquerque, NM 87185-0378              fax: 505 284 0154
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20080222/3306fbed/attachment.htm


More information about the ParaView mailing list