<div>Ali,<br><br>Strangely enough, I had a similar problem with that method just today. Here's how to fix it.<br><br>The GetCell() method in vtkCellArray is an internal method, which basically means that you shouldn't try to use it (it takes a parameter that specifies the offset into the cell array, rather than an index identifying the cell you want, making its use unintuitive). 
<br><br>Instead, you can use the GetCell() method right in the vtkPolyData class. Your code will look something like this (my VTK with Tcl is a little rusty, so it is in C++ below):<br><br>vtkPolyData *polyData = obj-&gt;GetOutput();
<br>cout &lt;&lt; &quot;Poly 1:&quot; &lt;&lt; polyData-&gt;GetCell(0) &lt;&lt; endl;<br><br>I *think* the equivalent code in Tcl is:<br><br>set polyData [obj GetOutput]<br>puts &quot;Poly 1: [polyData GetCell 0]<br><br>This should output the first cell in your OBJ file.
<br><br>Hope this helps.<br>&nbsp;<br>Cory<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">Hello,&nbsp;&nbsp;I'm trying to get a list of all polygons for my imported obj file.
<br>Here is a little code fragment of how i'm trying to do it.<br><br>vtkPolyData polyData<br>&nbsp;&nbsp;&nbsp;&nbsp;polyData SetPolys [[obj GetOutput] GetPolys]<br>&nbsp;&nbsp;&nbsp;&nbsp;puts &quot;Poly1: [[polyData GetPolys] GetCell 0]&quot;<br><br>I'm getting an error saying that GetCell is not being given the correct
<br>parameters and i'll probably agree with it!&nbsp;&nbsp;I think what i need to do is<br>access each Cell in the cell array.<br><br>Any help would be much appreciated.<br><br>If you need any extra information please don't hesitate to ask.
<br></blockquote><br>-- <br>Cory Quammen<br>University of North Carolina at Chapel Hill<br><a href="http://www.cs.unc.edu/~cquammen">http://www.cs.unc.edu/~cquammen</a><br>