<div dir="ltr">The only 2 things that I find strange are:<div><br></div><div><span style="font-size:13px">writer.SetInputConnection(</span><span style="font-size:13px">elementFaceActor.GetMapper().</span><span style="font-size:13px">GetOutputPort()); // (option 1)</span><br style="font-size:13px"><span style="font-size:13px">writer.SetInputData(</span><span style="font-size:13px">elementFaceActor.GetMapper().</span><span style="font-size:13px">GetInputAsDataSet()); </span><span style="font-size:13px">// (option 2)</span><br></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">Which option are you using? What type of dataset are you using initially? Did you try vtkDataSetWriter/Reader, to see if you had similar behavior? </span></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px">Seb</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 10:01 PM, kent myers via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to export to XML using the vtkXMLPolyDataWriter from Java using<br>
the following code:<br>
<br>
        public void exportGraphicFile(String filename) {<br>
            //Write the file<br>
            vtkXMLPolyDataWriter writer = new vtkXMLPolyDataWriter();<br>
            writer.SetFileName(filename);<br>
<br>
writer.SetInputConnection(elementFaceActor.GetMapper().GetOutputPort());<br>
//<br>
writer.SetInputData(elementFaceActor.GetMapper().GetInputAsDataSet());<br>
<br>
            //Optional - set the mode. The default is binary.<br>
            //writer.SetDataModeToBinary();<br>
            writer.SetDataModeToAscii();<br>
            writer.Update();<br>
            writer.Write();<br>
        }<br>
<br>
I get a file that has some XML tags (see attached file), but it does not<br>
appear to be complete, and I do not get anything back when I attempt to<br>
import it using vtkXMLPolyDataReader as shown below:<br>
<br>
        public void importGraphicFile(String filename) {<br>
            //read all the data from the file<br>
            vtkXMLPolyDataReader reader = new vtkXMLPolyDataReader();<br>
            reader.SetFileName(filename);<br>
            reader.Update();<br>
<br>
            //Create a mapper and actor<br>
            vtkPolyDataMapper mapper = new vtkPolyDataMapper();<br>
            mapper.SetInputConnection(reader.GetOutputPort());<br>
<br>
            elementFaceActor.SetMapper(mapper);<br>
             SimfinitTestHex2.vtk<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5731801/SimfinitTestHex2.vtk" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5731801/SimfinitTestHex2.vtk</a>><br>
            updateView();<br>
<br>
        }<br>
<br>
Does anyone know what I am doing wrong?<br>
<br>
Thanks!<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Using-vtkXMLPolyDataWriter-from-Java-tp5731801.html" target="_blank">http://vtk.1045678.n5.nabble.com/Using-vtkXMLPolyDataWriter-from-Java-tp5731801.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>