<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hi Pat,<br><br>thank you for the fast help! As mentioned I am still beginner with ParaView and do not know all the insights from ParaView. Furthermore I have to say that at the moment (we are just beginning to use ParaView) both the server and the client do run on the same machine (but in the future we as well like to run it on seperate machines)<br><br>First of all I have to say that the provided solution does not work as it was written here. It terminates with the following error:<br><br><br><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">Traceback (most recent call last):</span>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">  File "&lt;string&gt;", line 26, in &lt;module&gt;</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">  File "&lt;string&gt;", line 4, in RequestData</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">  File "C:\Program Files (x86)\ParaView 3.12.0\lib\paraview-3.12\site-packages\paraview\servermanager.py", line 1502, in GetProxiesInGroup</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">    for aProxy in iter:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">  File "C:\Program Files (x86)\ParaView 3.12.0\lib\paraview-3.12\site-packages\paraview\servermanager.py", line 1706, in next</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">    self.AProxy = _getPyProxy(self.SMIterator.GetProxy())</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">  File "C:\Program Files (x86)\ParaView 3.12.0\lib\paraview-3.12\site-packages\paraview\servermanager.py", line 2227, in _getPyProxy</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">    classForProxy = _findClassForProxy(_make_name_valid(xmlName), smproxy.GetXMLGroup())</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">  File "C:\Program Files (x86)\ParaView 3.12.0\lib\paraview-3.12\site-packages\paraview\servermanager.py", line 2289, in _findClassForProxy</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">    return filters.__dict__[xmlName]</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:8.25pt; color:#800000;">NameError: global name 'filters' is not defined</span></p><br><br>Dealing a bit more with the python interface I found out, that Proxy is not the correct thing I really need - I believe that I rather would need the filter.<br>To understand what I want to do:<br>-) the user loads a file series of vtu or inp files<br>-) then he can should apply the python programmable filter<br>&nbsp;&nbsp; This filter should then open a txt file (which will always be placed in the same directory as the vtu/inp files).<br>&nbsp;&nbsp; The filter will then parse the txt file and according to the actual inp/vtu file in the file series it will read a certain value from this text file. This value will be used as x value whereas the y value is calculated by using several vtk filters in the python programmable filter (calculating the y value does already work properly).<br><br>In order to automatically open this txt file I would need the directory from the first (input) filter. Furthermore I want to get the recent inp/vtu file name of the file series in order to get the correct information (=row) out of the txt file.<br><br>Perhaps somebody has another idea in order resolve this problem.<br><br>Markus<br><br><div><hr id="stopSpelling">From: pat.marion@kitware.com<br>Date: Mon, 14 Nov 2011 21:10:13 -0800<br>Subject: Re: [Paraview] Python Proogrammable Filter - Get Proxy<br>To: m_fuger@hotmail.com<br>CC: paraview@paraview.org<br><br>Hi Markus,<br><br>What you're trying to do is discouraged, you shouldn't attempt to access proxies from within the programmable filter.&nbsp; If you were running paraview in a client-server setup, it would not work because the filter and its proxy would exist on different processes.<br>

<br>Anyway, here's some code that may work for you:<br><br>
<style>
.ExternalClass p, .ExternalClass li
{white-space:pre-wrap;}
</style>
<p style="margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">import paraview.servermanager as sm</p>
<p style="margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></p>
<p style="margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">proxies = sm.ProxyManager().GetProxiesInGroup("sources").values()</p>
<p style="margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">selfProxy = [p for p in proxies if p.GetClientSideObject() is self][0]</p><br><br>Hope this helps!<br>

<br><br>Pat<br><br><br><div class="ecxgmail_quote">On Mon, Nov 14, 2011 at 2:07 PM, Markus Fuger <span dir="ltr">&lt;<a href="mailto:m_fuger@hotmail.com">m_fuger@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">





<div><div dir="ltr">
Hello,<br><br>I do like to program my own plugin based on a Python Programmable filter (PPF).<br>For some feature (I want to get the file directory of the files from the input of the very first proxy in the pipeline) I need the proxy object of the PPF.<br>

<br>If I once would have this object I could then loop the Input until there is none anymore and then read the FileInfo Field. But as described I would need the proxy object of the PPF first.<br>I did several tests with the self object as well as with the proxymanager but could not find a working solution. (I have to say that I am new to ParaView as well)<br>

<br>Perhaps somebody of this mailing list could help me!?<br><br>With kind regards,<br><font color="#888888">Markus<br>                                               </font></div></div>
<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>
<br></blockquote></div><br></div>                                               </div></body>
</html>