Great thanks JB,<br>that fits well<br><br><div class="gmail_quote">2011/7/8 Biddiscombe, John A. <span dir="ltr">&lt;<a href="mailto:biddisco@cscs.ch">biddisco@cscs.ch</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">this snippet may help you
<u></u><u></u></span></b></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;"><u></u> <u></u></span></b></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">     
<span style="color: green;">QList</span>&lt;<span style="color: green;">QVariant</span>&gt;
<span style="color: green;">blocks</span>;</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">     
<span style="color: green;">vtkPVCompositeDataInformation</span> *<span style="color: green;">pvcdi</span> =
<span style="color: green;">out</span>-&gt;<span style="color: green;">GetDataInformation</span>()-&gt;<span style="color: green;">GetCompositeDataInformation</span>();</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>

<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">     
<span style="color: green;">QList</span>&lt;<span style="color: green;">QVariant</span>&gt;
<span style="color: green;">blocks</span>;</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">     
<span style="color: maroon;">int</span> <span style="color: green;">N</span> = <span style="color: green;">
pvcdi</span>-&gt;<span style="color: green;">GetNumberOfChildren</span>();</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">     
<span style="color: maroon;">for</span> (<span style="color: maroon;">int</span> <span style="color: green;">
i</span>=<span style="color: red;">0</span>; <span style="color: green;">i</span>&lt;<span style="color: green;">N</span>;
<span style="color: green;">i</span>++) {</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">        if (...)
<span style="color: green;">blocks</span>.<span style="color: green;">append</span>(<span style="color: green;">i</span>+<span style="color: red;">1</span>);</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>

<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">      }</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">     
<span style="color: green;">pqSMAdaptor</span>::<span style="color: green;">setMultipleElementProperty</span>(</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">       
<span style="color: maroon;">this</span>-&gt;<span style="color: green;"> Pipeline</span>-&gt;<span style="color: green;">GetProperty</span>(<span style="color: blue;">&quot;BlockIndices&quot;</span>),
<span style="color: green;">blocks</span>);  </span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>
<p class="MsoNormal" style=""><b><span style="font-family: &quot;Courier New&quot;;">      <span style="color: maroon;">this</span>-&gt;<span style="color: green;">Pipeline</span>-&gt;<span style="color: green;">UpdateProperty</span>(<span style="color: blue;">&quot;BlockIndices&quot;</span>);</span></b><span style="font-family: &quot;Courier New&quot;;"><u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">assuming you’re inside a pqSomething class and have access to all the usual pqSMAdaptor stuff. From raw servermanager stuff it’d look different<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">JB<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@paraview.org</a> [mailto:<a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@paraview.org</a>]
<b>On Behalf Of </b>papa ndéné NDIAYE<br>
<b>Sent:</b> 08 July 2011 12:20<br>
<b>To:</b> <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
<b>Subject:</b> [Paraview] vtkSMIntVectorProperty number of elements<u></u><u></u></span></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hi, all<br>
I have built a Toolbar plugin in paraview with a button that applies extractblock filter to a multiblock dataset<br>
so as to get all the blocks seperately in different objects in the pipeline browser.<br>
<br>
I achieve getting the number of blocks from the selected multiblock but I don&#39;t know how to set the block indice<br>
of an extract block filter after having it buit.<br>
<br>
<b><br>
vtkSMProperty* property= [the pqPipelineSource resulting from createFilter]-&gt;GetProperty(&quot;BlockIndices&quot;);<br>
<br>
vtkSMIntVectorProperty * indices= vtkSMIntVectorProperty::SafeDownCast(property);<br>
<br>
</b>but <b>&quot;indices-&gt;GetNumberOfElements();&quot; </b>returns 0 while the compositeTreeWidget displays the blocks&#39; hierarchy.<br>
<br>
how can I modify a vtkSMProperty within the code?<br>
<br>
thanks in advance!<u></u><u></u></p>
</div></div></div>
</div>

</blockquote></div><br>