If your intention is to just clear the pipeline, try this code, copied from the paraview coprocessor template:<br><br>def GetProxiesToDelete():<br> iter = servermanager.vtkSMProxyIterator()<br> iter.Begin()<br> tobedeleted = []<br>
while not iter.IsAtEnd():<br> if iter.GetGroup().find("prototypes") != -1:<br> iter.Next()<br> continue<br> proxy = servermanager._getPyProxy(iter.GetProxy())<br> proxygroup = iter.GetGroup()<br>
iter.Next()<br> if proxygroup != 'timekeeper' and proxy != None and proxygroup.find("pq_helper_proxies") == -1 :<br> tobedeleted.append(proxy)<br><br> return tobedeleted<br><br># explicitly delete the proxies -- we do it this way to avoid problems with prototypes<br>
tobedeleted = GetProxiesToDelete()<br>while len(tobedeleted) > 0:<br>
Delete(tobedeleted[0])<br>
tobedeleted = GetProxiesToDelete()<br><br><br><div class="gmail_quote">On Wed, Sep 15, 2010 at 3:21 PM, pat marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I'm afraid your use case is not well supported. There is logic in the paraview gui application that ensures a clean disconnect, which includes a hard reset of the python interpreter context. Using only python modules, there is manual clean up required after a disconnect that is not yet supported.<br>
<br>You might find that your script still works, you'll just be be spammed with those error messages. Also, try calling Connect() instead of servermanager.Disconnect(...). This will disconnect & reconnect a little more cleanly, but still not perfect.<br>
<font color="#888888">
<br>Pat</font><div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Wed, Sep 15, 2010 at 2:52 PM, logari81 <span dir="ltr"><<a href="mailto:logari81@googlemail.com" target="_blank">logari81@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
In the meanwhile I have realized that the error occurs only when I<br>
include a Delete() statement in my script. Thus the following very<br>
simple script reproduces the error:<br>
<br>
import sys<br>
sys.path.append('/usr/lib/paraview')<br>
from paraview.simple import *<br>
cone = Cone()<br>
Delete(cone)<br>
servermanager.Disconnect(servermanager.ActiveConnection)<br>
<br>
Hopefully someone can explain this behavior.<br>
<br>
Best Regards<br>
<br>
Kostas<br>
<div><div></div><div><br>
<br>
On Wed, 2010-09-15 at 18:59 +0200, logari81 wrote:<br>
> Hi,<br>
><br>
> actually I have the same question as in this previous email:<br>
><br>
> <a href="http://www.paraview.org/pipermail/paraview/2008-March/007506.html" target="_blank">http://www.paraview.org/pipermail/paraview/2008-March/007506.html</a><br>
><br>
> I use the python interface in an application that I am developing and I<br>
> import paraview with:<br>
><br>
> from paraview.simple import *<br>
><br>
> During the import a connection to the builtin server is also established<br>
> silently. Though, in my application I need to clear the pipeline<br>
> occasionally in order to begin with a new output, so I tried<br>
> disconnecting from the server with:<br>
><br>
> servermanager.Disconnect(servermanager.ActiveConnection)<br>
><br>
> but I receive the error:<br>
><br>
> ERROR:<br>
> In /build/buildd/paraview-3.8.0/Servers/Common/vtkProcessModuleConnectionManager.cxx, line 175<br>
> vtkProcessModuleConnectionManager (0x1d33240): Invalid connection ID: 5<br>
><br>
> This behavior is tested with ParaView 3.8.0 on Ubuntu 10.04.<br>
><br>
> I would be glad for any hints.<br>
><br>
> Kind Regards<br>
><br>
> Kostas<br>
><br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>