Thank you very much, yes I made a mistake on the argument type.  The problem has been solved now :)<br><br>The code looks like the following<br><br>    num = model.GetNumberOfPoints()<br>    ids = vtk.vtkIdList()<br>    ids.SetNumberOfIds(num);<br>

    model.Allocate(1,1)<br><br>    for i in range(0, num):<br>        ids.SetId(i, i)<br>        model.InsertNextCell(vtk.VTK_VERTEX, ids)<br><br><div class="gmail_quote">On Mon, Jan 11, 2010 at 3:13 PM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Youbing,<br>
<br>
For the second parameter for InsertNextCell() use a vtkIdList, not a<br>
vtkIdType.  But as for for vtkIdType, it&#39;s just a typedef as Jerome<br>
says.  In Python, you can use a python &quot;int&quot; or &quot;long&quot; for vtkIdType.<br>
<font color="#888888"><br>
   David<br>
</font><div><div></div><div class="h5"><br>
On Mon, Jan 11, 2010 at 7:10 AM, Jérôme &lt;<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; In python, as far as I remember, the type of the data is given by the first<br>
&gt; affectation. And in vtkType.h,<br>
&gt; vtkIdType is a simple c++ define of int (basically speaking. It seems to<br>
&gt; handle 64/32 integer cases.).<br>
&gt; I think you should not have to give such a type to your &quot;id&quot;...<br>
&gt;<br>
&gt; Can you be more precise about your problem? eg giving code, error messages,<br>
&gt; etc. ?<br>
&gt;<br>
&gt; Jerome<br>
&gt;<br>
&gt; 2010/1/11 Youbing Zhao &lt;<a href="mailto:zhaoyoubing@gmail.com">zhaoyoubing@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Dear Guys,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m try to call vtkPolyData.InsertNextCell(1, id) in Python which requires<br>
&gt;&gt; a vtkIdType variable as the second input.<br>
&gt;&gt;<br>
&gt;&gt; But I have no idea of setup a vtkIdType variable. I tried vtk.vtkIdType,<br>
&gt;&gt; but it&#39;s not in the module.<br>
&gt;&gt;<br>
&gt;&gt; Does anybody has the experience?<br>
&gt;&gt;<br>
&gt;&gt; Thank you very much<br>
&gt;&gt;<br>
&gt;&gt; Youbing<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Youbing Zhao(趙友兵)<br>Phone: (+44) 75 0202 1598  (UK)<br>           (+86) 135 8571 8767 (中國)<br>Email : <a href="mailto:zhaoyoubing@gmail.com">zhaoyoubing@gmail.com</a><br>
MSN  : <a href="mailto:zhaoyoubing@hotmail.com">zhaoyoubing@hotmail.com</a><br>