<div dir="ltr"><div>Hi,<br><br></div><div>Where did you get the example from? <br><br></div><div>I think your confusion is from the difference between multiblock data sets and regular data sets. The regular data set has points and the Programmable Filter gives a shortcut to access those points by using inputs[0].Points and output.Points but there is no concept of a group of points in a multiblock data set, only in the regular data set blocks of the multiblock data set. So for the process_block() method you&#39;ll want to do a block.GetPoints() to get the points. To make it more efficient you can use numpy. An example is at <a href="http://www.paraview.org/Wiki/Python_Programmable_Filter#Center_Data_using_numpy">http://www.paraview.org/Wiki/Python_Programmable_Filter#Center_Data_using_numpy</a>. <br>
<br></div><div>You can add print statements in the script but they&#39;ll be outputted to the output window (Tools-&gt;Output Window).<br></div><div><br></div><div>Regards,<br>Andy <br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Oct 17, 2013 at 10:35 AM,  <span dir="ltr">&lt;<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font face="sans-serif">My original post was truncated into oblivion,
so here is my Second attempt.</font>
<br>
<br><font face="sans-serif">I&#39;m trying to put together a Programmable
filter that will add arrays of deformed and undeformed coordinates and
undeformed angles to my PointData in 4.0.1</font>
<br>
<br><font face="sans-serif">From all the examples online, I think
either of these examples should work but neither does.   Any hints</font>
<br><font face="sans-serif">First, I am copying arrays in the PF,
so I should be able to manipulate either input or output, but neither works</font>
<br><font face="sans-serif">It is also a composite (Exodus dataset)</font>
<br>
<br><font face="sans-serif">First version - error is can&#39;t find
output.Points</font>
<br>
<br><font face="Courier New">import math</font>
<br>
<br><font face="Courier New">def process_block(block):</font>
<br><font face="Courier New">   displ=block.PointData[&#39;DISPL&#39;]</font>
<br><font face="Courier New">   # Coords of Points are
locked into individual Point structures</font>
<br><font face="Courier New">   # Assume Displacements
applied (Points are deformed)</font>
<br><font face="Courier New">   numPts=output.GetNumberOfPoints()</font>
<br><font face="Courier New">#   for i in range(numPts):</font>
<br><font face="Courier New">#      #x_coords[i],
y_coords[i], z_coords[i] = output.GetPoint(i)</font>
<br>
<br><font face="Courier New">   x_coords=output.Points[:,0]</font>
<br><font face="Courier New">   y_coords=output.Points[:,1]</font>
<br><font face="Courier New">   z_coords=output.Points[:,2]</font>
<br><font face="Courier New">   x_undef=x_coords-displ[:,0]</font>
<br><font face="Courier New">   y_undef=y_coords-displ[:,1]</font>
<br><font face="Courier New">   z_undef=z_coords-displ[:,2]</font>
<br><font face="Courier New">   # Undeformed scalar Coordinates</font>
<br><font face="Courier New">   block.PointData.append(x_undef,&quot;X_undef&quot;)</font>
<br><font face="Courier New">   block.PointData.append(y_undef,&quot;Y_undef&quot;)
  </font>
<br><font face="Courier New">   block.PointData.append(z_undef,&quot;Z_undef&quot;)</font>
<br><font face="Courier New">   # Deformed scalar Coordinates</font>
<br><font face="Courier New">   block.PointData.append(x_coords,&quot;X_def&quot;)</font>
<br><font face="Courier New">   block.PointData.append(y_coords,&quot;Y_def&quot;)</font>
<br><font face="Courier New">   block.PointData.append(z_coords,&quot;Z_def&quot;)</font>
<br><font face="Courier New">   # Calc angles (no atan2
in vtk)</font>
<br><font face="Courier New">   Angles_undef=math.atan2(z_undef,x_undef)</font>
<br><font face="Courier New">   block.PointData.append(Angles_undef,&quot;Angle_undef&quot;)</font>
<br>
<br><font face="Courier New">for block in output:</font>
<br><font face="Courier New">   process_block(block)</font>
<br>
<br><font face="sans-serif">For second version I comment out x_coords=output.Points[;0]
and use </font>
<br><font face="Courier New">#   for i in range(numPts):</font>
<br><font face="Courier New">#      #x_coords[i],
y_coords[i], z_coords[i] = output.GetPoint(i)</font>
<br>
<br><font face="sans-serif">This error is can&#39;t find output.GetPoint</font>
<br>
<br><font face="sans-serif">Both of these are used in examples online
of Programmable Filter, so what am I missing?</font>
<br><font face="sans-serif">I have substituted input for output
above and no change.   </font>
<br><font face="sans-serif">Also, output.GetNumberOfPoints works,
so why doesn&#39;t output.GetPoints work?</font>
<br>
<br><font face="sans-serif">Thanks</font>
<br>
<br><font color="#002060" face="Verdana" size="1"><b>Dennis Conklin</b><i><br>
<b>RDE &amp; Q Senior Engineer </b></i></font>
<br><font color="#002060" face="Verdana" size="1"><b><i>Engineering Mechanics</i></b><i><br>
</i>The Goodyear Tire &amp; Rubber Company</font>
<br><font color="#002060" face="Verdana" size="1">200 Innovation Way, Akron,
OH  44316<br>
phone.<a href="tel:330-796-5701" value="+13307965701" target="_blank">330-796-5701</a><br>
<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a></font>
<br>
<br><img src="cid:_2_06BD2A6006BD27F40050237D85257C07"><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>