[Paraview] [EXT] Re: How to detect valid read in Programmable filter
Dennis Conklin
dennis_conklin at goodyear.com
Tue Aug 4 08:20:06 EDT 2015
Dan,
Thanks for that hint. A little experimenting proved that the fully qualified name didn’t work but dataset_adapter.VTKNoneArray worked so I wrapped up my filter this morning
Dennis
From: Dan Lipsa [mailto:dan.lipsa at kitware.com]
Sent: Monday, August 03, 2015 11:31 PM
To: Dennis Conklin; Paraview (paraview at paraview.org)
Subject: [EXT] Re: [Paraview] How to detect valid read in Programmable filter
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<mailto: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<http://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/61cd2923/attachment.html>
More information about the ParaView
mailing list