<HTML>
<HEAD>
<TITLE>Re: [Paraview] Extract cell type from unstructured grid</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Paul,<BR>
<BR>
I don&#8217;t know of any existing filter to do that, but a pretty simple programmable filter can do it. &nbsp;Here is the script that will achieve it. &nbsp;Just create a custom filter and copy this into the script.<BR>
<BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>input = self.GetUnstructuredGridInput()
output = self.GetUnstructuredGridOutput()
output.GetPointData().PassData(input.GetPointData())
output.GetCellData().PassData(input.GetCellData())

cellTypes = vtk.vtkUnsignedCharArray()
cellTypes.DeepCopy(input.GetCellTypesArray())
cellTypes.SetName(&quot;Cell Types&quot;)
output.GetCellData().AddArray(cellTypes)
<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>If you plan to use this multiple times, you probably want to wrap this in a custom filter.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 2/18/09 5:07 AM, &quot;Paul Edwards&quot; &lt;<a href="paul.m.edwards@gmail.com">paul.m.edwards@gmail.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
Does anyone know an easy way to extract all cells of a particular type from an unstructured grid (without writing code either a plugin or python script)? &nbsp;I was thinking it be possible with the calculator and the number of points in a cell but I can't get access to that.<BR>
<BR>
Thanks,<BR>
Paul<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:7.5pt'><BR>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>