<div dir="ltr">Hi Dennis,<div>Try</div><div> isinstance(displ, vtk.numpy_interface.dataset_adapter.VTKNoneArray)<br></div><div><br></div><div>Dan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 3, 2015 at 4:40 PM Dennis Conklin <<a href="mailto:dennis_conklin@goodyear.com">dennis_conklin@goodyear.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">All,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I want to try to read some point arrays in the Programmable Filter and take action based on whether or not the arrays have been loaded into Paraview. I am pretty lost in the PF, so take that for what it’s worth.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If I try something like<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">try:<u></u><u></u></p>
<p class="MsoNormal"> displ=block.PointData[‘DISPL’]<u></u><u></u></p>
<p class="MsoNormal"> Print displ<u></u><u></u></p>
<p class="MsoNormal">except:<u></u><u></u></p>
<p class="MsoNormal"> Print ‘DISPL read failed’<u></u><u></u></p>
<p class="MsoNormal">else: <u></u><u></u></p>
<p class="MsoNormal"> Print ‘DISPL read succeeded’<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The try never fails – it always prints “DISPL read succeeded, whether I actually loaded the DISPL array or not.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If I print displ, I get an array of values if I loaded the DISPL array into Paraview and a vtk.numpy_interface.dataset_adapter.VTKNoneArray object if I haven’t loaded the array.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Not to be too dense, but how do I test to see if I got an array or a VTKNoneArray object?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Dennis<u></u><u></u></p>
</div>
</div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote></div>