<div dir="ltr"><div><div><div>Hi Tim,<br><br></div>I believe that the writer you want is the XML multiblock data writer -- XMLMultiBlockDataWriter(). The extension for that is .vtm. The reason for this is that a slice through a multiblock data set outputs a multiblock of polydata. You can use the Merge Blocks filter to reduce it to an unstructured grid.<br><br></div>Cheers,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 26, 2015 at 8:21 PM, Tim Gallagher <span dir="ltr"><<a href="mailto:tim.gallagher@gatech.edu" target="_blank">tim.gallagher@gatech.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm struggling to write a script for Paraview that will let me take a slice through my vtkMultiblockDataSet and save just the slice (so all of the data on the slice and all of the points that make up the slice) in a format that I can look at later. I can get it to dump all of the data to a set of CSV files, but I can't look at those again in paraview.<br>
<br>
My function is very simple (see below). I have tried to use CreateWriter directly with the .vtk file extension like is shown on <a href="http://www.paraview.org/Wiki/ParaView/Python_Scripting#Writing_Data_Files_.28ParaView_3.9_or_later.29" rel="noreferrer" target="_blank">http://www.paraview.org/Wiki/ParaView/Python_Scripting#Writing_Data_Files_.28ParaView_3.9_or_later.29</a> but that says the vtk file format is unknown and so it doesn't work.<br>
<br>
I have tried virtually every writer that would make sense in that writer line and none of them work properly. As it is, the one that is there now says:<br>
<br>
vtkCompositeDataPipeline (0x9ac9380): Can not execute simple alorithm without output ports<br>
<br>
and I don't know what that means or why it fails to write. (Side note -- algorithm is spelled wrong in that error message, comes from vtkCompositeDataPipeline.cxx line 168).<br>
<br>
Anybody have any suggestions or advice on how to save the datasets that results from a slice so I can look at just that slice later?<br>
<br>
Thanks,<br>
<br>
Tim<br>
<br>
def run(out_dir, file_num, spreadsheet_name, slice_origin, slice_normal, triangulate=False):<br>
    restart_file = XDMFReader(FileName=out_dir+'/RESTS/rest_%05i.xmf' % file_num)<br>
    restart_file_dr = Show()<br>
<br>
    if triangulate:<br>
        tri = 1<br>
    else:<br>
        tri = 0<br>
<br>
    my_slice = Slice(SliceOffsetValues=[0.0], Triangulatetheslice=tri, SliceType="Plane" )<br>
    my_slice.SliceType.Origin = slice_origin<br>
    my_slice.SliceType.Normal = slice_normal<br>
<br>
    slice_dr = Show()<br>
<br>
    writer = XMLUnstructuredGridWriter(Input=my_slice)<br>
    writer.FileName = out_dir+"/post/"+"%s_data_%05i_.vtu" % (spreadsheet_name, file_num)<br>
    writer.UpdatePipeline()<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote></div><br></div>