[Paraview] vtkPythonProgrammableFilter, could not find requested method: "SetCellArrayStatus" ?
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Mon Jun 27 14:56:29 EDT 2016
Attached a fixed version. I've also change the "Script" to just print
the value for sFields which is a array of selected array names. You'll
need to update your code accordingly. Note, if the user selected
nothing then sFields will not be defined. So you may want to handle
that in your code as well.
On Mon, Jun 27, 2016 at 1:30 PM, Dean Neumann <dwneumann at gmail.com> wrote:
> Fellas, can someone please point me to examples (current as of v5.0.1) of
> how a PythonProgrammableFilter accesses the values of properties entered via
> a DropDownList on the filter's Properties panel....
>
> I have written a Python programmable filter which extracts user-specified
> field arrays from user-specified blocks of multiple (MultiBlock) input
> datasets. I use this to perfrom statistical analysis of values from many
> different simulatyions.
> The filter works fine when the field array names and block numbers are
> hardcoded in the script.
> .
> Then I used Pat Marion's python_filter_generator.py to wrap the filter in
> XML and allow these values to be entered via TextBoxes in the Properties
> panel. That also works fine. The property TextBoxes are accessible to the
> Python script and I can retrieve the user-entered values.
>
> Then I attempted to change the field array input widget from a textbox to a
> DropDownList of cell arrays with checkboxes for selection, following the
> example in
> http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Drop_down_list. The
> DropDownList does appear correctly, populated correctly, along with
> checkboxes for selecting items from the list. However when I hit Apply I
> get the following error:
>
>>>
>>> ERROR: In
>>> C:\bbd\5105004d\build\paraview\src\paraview\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx,
>>> line 390
>>>
>>> vtkPVSessionCore (00000000036E8610): Object type:
>>> vtkPythonProgrammableFilter, could not find requested method:
>>> "SetCellArrayStatus"
>>>
>>> or the method was called with incorrect arguments.
>>>
>>>
>>> while processing
>>>
>>> Message 0 = Invoke
>>>
>>> Argument 0 = vtk_object_pointer {vtkPythonProgrammableFilter
>>> (000000000D1BCCD0)}
>>>
>>> Argument 1 = string_value {SetCellArrayStatus}
>>>
>>> Argument 2 = string_value {cellInputs}
>>>
>>> Argument 3 = int32_value {0}
>>>
>>>
>>> ERROR: In
>>> C:\bbd\5105004d\build\paraview\src\paraview\ParaViewCore\ServerImplementation\Core\vtkPVSessionCore.cxx,
>>> line 391
>>>
>>> vtkPVSessionCore (00000000036E8610): Aborting execution for debugging
>>> purposes.
>>>
>>>
>>> ERROR: In
>>> C:\bbd\5105004d\build\paraview\src\paraview\ParaViewCore\ServerImplementation\Core\vtkSIProxy.cxx,
>>> line 134
>>>
>>> vtkSISourceProxy (000000000A29BFE0): Error pushing property state:
>>> CellArrayStatus
>
>
> I looked at the examples in
> ParaView/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml as
> suggested, but nowhere do I see examples of how a Python script accesses the
> user's selections (only examples of the XML code is shown, not the Python
> scripts). I also perused the site-packages subdirectory of my installation,
> but those are all compiled Python and of no help.
>
> I'm sure if I just see some Python code examples I can get this working. I
> have attached my filter if that helps...
> many thanks for your help.
>
> Dean Neumann
> CEO, Malaspina Lans Inc
>
>
> _______________________________________________
> 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 --------------
A non-text attachment was scrubbed...
Name: SliceAcrossDatasets_Dropdown.xml
Type: text/xml
Size: 2857 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160627/c16f87f2/attachment.xml>
More information about the ParaView
mailing list