[Paraview] How to detect valid read in Programmable filter

Dan Lipsa dan.lipsa at kitware.com
Mon Aug 3 23:31:01 EDT 2015


Hi Dennis,
Try
 isinstance(displ, vtk.numpy_interface.dataset_adapter.VTKNoneArray)

Dan


On Mon, Aug 3, 2015 at 4:40 PM Dennis Conklin <dennis_conklin at goodyear.com>
wrote:

> All,
>
>
>
> 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.
>
>
>
> If I try something like
>
>
>
> try:
>
>    displ=block.PointData[‘DISPL’]
>
>    Print displ
>
> except:
>
>    Print ‘DISPL read failed’
>
> else:
>
>    Print ‘DISPL read succeeded’
>
>
>
> The try never fails – it always prints “DISPL read succeeded, whether I
> actually loaded the DISPL array or not.
>
>
>
> 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.
>
>
>
> Not to be too dense, but how do I test to see if I got an array or a
> VTKNoneArray object?
>
>
>
> Thanks
>
>
>
> Dennis
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150804/9a1266a4/attachment.html>


More information about the ParaView mailing list