# Drop down list error

**URL:** https://discourse.paraview.org/t/drop-down-list-error/3554
**Category:** ParaView Support
**Tags:** python
**Created:** [February 12, 2020, 1:38pm UTC](https://discourse.paraview.org/t/drop-down-list-error/3554 "2020-02-12T13:38:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MiguelAngelAGUIRRE](https://discourse.paraview.org/user_avatar/discourse.paraview.org/miguelangelaguirre/32/2986_2.png) [@MiguelAngelAGUIRRE](https://discourse.paraview.org/u/MiguelAngelAGUIRRE)
#### Post date: [February 12, 2020, 1:38pm UTC](https://discourse.paraview.org/t/drop-down-list-error/3554/1 "2020-02-12T13:38:44Z")

</div>

Dear all ,

I’m trying to do a Programmable Filter with a **dynamic drop down list** , where the displayed properties in the GUI depend on the selected option in the drop down list (See cases A and B in the next figure):

![image](https://discourse.paraview.org/uploads/default/original/2X/0/04f8f1553bc51c62e20be16ed7004944d7af1129.png)

So far, I succeeding in creating this interface in the filter, i.e., this dynamic drop down list appear when I apply the filter and I obtain the cases A and B from the figure. You can check this by using the attached PVSM file (it requires first to load the plugin -xml file-).

However, when I click on the “Apply” button, there is an error related to the XML file:

_Object type: vtkPythonProgrammableFilter, could not find requested method: “SetParameter” or the method was called with incorrect arguments._

I have the feeling that the error come from line 80 (XML file) because I used **command=“SetParameter”** whereas in the original example ([https://github.com/themiwi/ParaView/blob/master/Examples/Plugins/ParametricSource/ParametricSource.xml](https://github.com/themiwi/ParaView/blob/master/Examples/Plugins/ParametricSource/ParametricSource.xml)) it is used “ **SetParametricFunction** ”.

Do you have any idea to solve this problem?

Thanks in advance.

Miguel Angel AGUIRRE

[DROP\_DOWN\_ERROR.pvsm](https://discourse.paraview.org/uploads/short-url/se1cPPnKpDISplzeDmTaLd9l0Fz.pvsm) (292.5 KB) [DROP\_DOWN\_LIST\_TEST.xml](https://discourse.paraview.org/uploads/short-url/bBWJwEQAsN4SokextmIwRawb0gk.xml) (2.6 KB) [PV\_ERROR\_TEST.cas](https://discourse.paraview.org/uploads/short-url/okmKMzNzBHlKKqDbOHCy5Iagqlx.cas) (298.6 KB) [PV\_ERROR\_TEST.dat](https://discourse.paraview.org/uploads/short-url/o6u5IH8HmY3dyNC4hCu9kGF7TYh.dat) (491.3 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 12, 2020, 1:40pm UTC](https://discourse.paraview.org/t/drop-down-list-error/3554/2 "2020-02-12T13:40:42Z")

</div>

Is this a C++ ou python plugin ?

---

<div class="post-metadata">

### Author: ![MiguelAngelAGUIRRE](https://discourse.paraview.org/user_avatar/discourse.paraview.org/miguelangelaguirre/32/2986_2.png) [@MiguelAngelAGUIRRE](https://discourse.paraview.org/u/MiguelAngelAGUIRRE)
#### Post date: [February 12, 2020, 1:55pm UTC](https://discourse.paraview.org/t/drop-down-list-error/3554/3 "2020-02-12T13:55:08Z")

</div>

Hello,

Yes, it is a **Python** plugin.

By the way, I omitted the python file for simplicity. In fact, in line 72 it let:  
default\_values=“print Method\_1”\>

but it could also be:  
default\_values=“execfile(‘C:/FilePath/Python\_File.py’)”\>

Thanks again

Miguel

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [February 12, 2020, 4:23pm UTC](https://discourse.paraview.org/t/drop-down-list-error/3554/4 "2020-02-12T16:23:06Z")

</div>

All versions of [vtkPythonProgrammableFilter::SetParameter()](https://kitware.github.io/paraview-docs/nightly/cxx/classvtkPythonProgrammableFilter.html#a5acdd5ad2ebc4bc18279840d8ba3d4af) take two arguments. You are providing one, hence the error message.

> [@MiguelAngelAGUIRRE](#):
>
> in the original example ([ParaView/Examples/Plugins/ParametricSource/ParametricSource.xml at master · wildmichael/ParaView · GitHub](https://github.com/themiwi/ParaView/blob/master/Examples/Plugins/ParametricSource/ParametricSource.xml)) it is used “ **SetParametricFunction** ”.

Note that the ParametricSource example does not use the `vtkPythonProgrammableFilter` but an entirely different VTK class, so it is not a useful reference. Take a look at [ParaView/Examples/Plugins/HelixSource/helix.xml at master · wildmichael/ParaView · GitHub](https://github.com/wildmichael/ParaView/blob/master/Examples/Plugins/HelixSource/helix.xml) instead to see how to use `SetParameter()`.

---

<div class="post-metadata">

### Author: ![MiguelAngelAGUIRRE](https://discourse.paraview.org/user_avatar/discourse.paraview.org/miguelangelaguirre/32/2986_2.png) [@MiguelAngelAGUIRRE](https://discourse.paraview.org/u/MiguelAngelAGUIRRE)
#### Post date: [February 13, 2020, 2:54pm UTC](https://discourse.paraview.org/t/drop-down-list-error/3554/5 "2020-02-13T14:54:49Z")

</div>

Hello,

Thanks for your answer.

However, I’m still struggling with this. The HelixSource example does not have a dynamic drop down list (just several classical “StringVectorProperty”). My XML code is quite different because it uses “ **ProxyProperty** ” to call the drop down list (Very similar to this example: [http://the-unofficial-paraview-developers-forum.34153.x6.nabble.com/InputArrayDomain-not-working-as-expected-from-proxylist-td4967.html](http://the-unofficial-paraview-developers-forum.34153.x6.nabble.com/InputArrayDomain-not-working-as-expected-from-proxylist-td4967.html)). My code is shown below.

In several forums I found that the command for the ProxyProperty is “Set+name” (i.e., if name=“Selection”, then command=“SetSelection”). I tried also this but it still not working.  
I’m confident about the first proxy group (“DropDownList”) because I can see that PV displays what I code there. However, the problem is in the second proxy group (“filters”), and more precisely in ProxyProperty, but I can not figure it out.

Any clue is welcomed. Thanks for your time!

Miguel

```
<!-- Here is defined the drop down list	for the GUI -->
<ProxyGroup name="DropDownList">
	<Proxy name="All_methods" class="vtkPythonProgrammableFilter">
			
		<IntVectorProperty 
			name="Method_A"
			command="SetParameter"
			initial_string="Method_A"
			number_of_elements="1"
			default_values="1">
			<BooleanDomain name="bool"/>
		</IntVectorProperty>
		
		<IntVectorProperty 
			name="Method_B"
			command="SetParameter"
			initial_string="Method_A"
			number_of_elements="1"
			default_values="1">
			<BooleanDomain name="bool"/>
		</IntVectorProperty>
		
	</Proxy>
	
	
	<Proxy name="None" class="vtkPythonProgrammableFilter">
	</Proxy>
	
	
	<Proxy name="Select_Method" class="vtkPythonProgrammableFilter">

		<IntVectorProperty 
			name="Method_1"
			command="SetParameter"
			initial_string="Method_1"
			number_of_elements="1"
			default_values="0">
			<BooleanDomain name="bool"/>
		</IntVectorProperty>
	  
		<IntVectorProperty 
			name="Method_2"
			command="SetParameter"
			initial_string="Method_2"
			number_of_elements="1"
			default_values="0">
			<BooleanDomain name="bool"/>
		</IntVectorProperty>

	</Proxy>
</ProxyGroup>

<ProxyGroup name="filters">
	<SourceProxy name="DROP_DOWN_LIST_TEST" 
				class="vtkPythonProgrammableFilter" 
				label="DROP_DOWN_LIST_TEST">
				
			<!-- Define the input port with data to be processed -->
			<InputProperty
				name="Input"
				command="SetInputConnection">
				<ProxyGroupDomain name="groups">
					<Group name="sources"/>
					<Group name="filters"/>
				</ProxyGroupDomain>
				<DataTypeDomain name="input_type">
					<DataType value="vtkDataSet"/>
				</DataTypeDomain>
			</InputProperty>
			
			<!-- Define the Paraview data set type as "Same as Input" (default value of 8 means "Same as Input") -->
			<IntVectorProperty 
				name="OutputDataSetType" 
				command="SetOutputDataSetType" 
				number_of_elements="1"
				default_values="8"
				panel_visibility="never"> 
			</IntVectorProperty>			
			
			<!-- Execute the Python script :	-->
			<StringVectorProperty 
				name="Script" 
				command="SetScript"
				number_of_elements="1"
				default_values="print Method_1">
				<Hints>
					<Widget type="multi_line"/>
				</Hints>
			</StringVectorProperty>
				
			<!-- Include the drop down list	-->
			<ProxyProperty
				name="Selection"
				command="SetSelection">
				<ProxyListDomain name="proxy_list">
					<Proxy group="DropDownList" name="All_methods" />
					<Proxy group="DropDownList" name="Select_Method" />
					<Proxy group="DropDownList" name="None" />
				</ProxyListDomain>
			</ProxyProperty>
 

	 
	</SourceProxy>
</ProxyGroup>

```
