<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’t know of any existing filter to do that, but a pretty simple programmable filter can do it. Here is the script that will achieve it. 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("Cell Types")
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, "Paul Edwards" <<a href="paul.m.edwards@gmail.com">paul.m.edwards@gmail.com</a>> 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)? 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>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <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>