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:[email protected]]
Sent: Monday, August 03, 2015 11:31 PM
To: Dennis Conklin; Paraview ([email protected])
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 
<[email protected]<mailto:[email protected]>> 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
_______________________________________________
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

Reply via email to