<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Jochen,<br>
    <br>
    I figured it out, and the SetNumberOfCompoents was not required. I
    was missing a header: vtkCellData.h. <br>
    <br>
    Thanks again for the help, you saved me some time. <br>
    <br>
    Peace,<br>
    Andrew<br>
    <br>
    <br>
    On 05/22/2012 02:08 PM, Jochen wrote:
    <blockquote cite="mid:1337710106141-5713312.post@n5.nabble.com"
      type="cite">
      <p><font face="Consolas" size="3">Andrew,<br>
          <br>
          I guess my code do have a bug, isn't it? Sorry for that. But
          I'm using C# and ActiViz<br>
          and do not have a working environment for C++/VTK. <br>
          So the shown code was just out of my mind without testing.<br>
          Accidently I missed a line ( see bold line in the code
          segement below).<br>
          &nbsp;</font></p>
      <p><font face="Consolas" size="3">&nbsp;&nbsp;</font><font face="Consolas"
          size="2"> ...<br>
          <font color="#2B91AF">&nbsp;&nbsp;
            vtkSmartPointer</font>&lt;<font color="#2B91AF">vtkUnstructuredGrid</font>&gt;
          grid = <font color="#2B91AF">vtkSmartPointer</font>&lt;<font
            color="#2B91AF">vtkUnstructuredGrid</font>&gt;::New();<br>
          &nbsp;&nbsp;
          ...<br>
          <br>
          <font color="#2B91AF">&nbsp;&nbsp;
            vtkSmartPointer</font>&lt;<font color="#2B91AF">vtkIdTypeArray</font>&gt;
          blockIds = <font color="#2B91AF">vtkSmartPointer</font>&lt;<font
            color="#2B91AF">vtkIdTypeArray</font>&gt;::New();<br>
          &nbsp;&nbsp; /* you can set another name, but then you must call<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          myVtkExodusIIWriter-&gt;SetBlockIdArrayName("yourElementBlockIdsName")
          <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in your IO-method. */</font></p>
      <p><font face="Consolas" size="2">&nbsp;&nbsp;
        </font><font face="Consolas" size="3"><b>blockIds-&gt;SetNumberOfComponents(1);</b></font><font
          face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // &lt;------------- sorry,
          I forgot this line<br>
          &nbsp;&nbsp;
          blockIds-&gt;SetName("ElementBlockIds"); <br>
          <br>
          &nbsp;&nbsp;
          for (vtkIdType i = 0; i &lt; grid-&gt;GetNumberOfCells(); i++)
          {<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          blockIds-&gt;InsertNextValue(blockId[i]); // blockId is a c++
          integer array which contains your block ids<br>
          &nbsp;&nbsp;
          }<br>
          &nbsp;&nbsp;
          grid-&gt;GetCellData()-&gt;AddArray(blockIds);</font></p>
      <p><font face="Consolas" size="3">&nbsp;&nbsp;
          ...<br>
          &nbsp;</font></p>
      <p><font face="Consolas" size="3">To make things clear to me did
          it fail to compile or did it fail during execution?<br>
          <br>
          with best regards<br>
          Jochen</font></p>
      <br>
      <hr align="left" width="300">
      View this message in context: <a moz-do-not-send="true"
href="http://vtk.1045678.n5.nabble.com/Subdomains-in-vtk-tp5713081p5713312.html">Re:
        Subdomains in vtk</a><br>
      Sent from the <a moz-do-not-send="true"
        href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html">VTK
        - Users mailing list archive</a> at Nabble.com.<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at: <a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>
</pre>
    </blockquote>
  </body>
</html>