<div dir="ltr">Hello Andrea,<div><br></div><div>Maybe a Programmable Filter would be a better way. I use this approach to create csv files with data comming from slices:</div><div><br></div><div><br></div><div><div>import csv</div></div><div><br></div><div>#Create an empty csv file with headers:</div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">FilePath = "C:/Users/Miguel Angel AGUIRRE/Desktop/DataOutput.csv"</span>

<br></div><div>Headers=["X","Y","Z","PRESSURE","VELOCITY"]  <br></div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><div>with open(FilePath, 'wb') as csvfile:</div><div>        filewriter = csv.writer(csvfile, delimiter=',')</div><div>        filewriter.writerow(Headers)</div></div>

<br></div><div># Get array data from input:</div><div>X = inputs[0].Points[:,0][0]         </div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Y = inputs[0].Points[:,1][0] </span> </div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Z = inputs[0].Points[:,2][0] </span>

 
                                           <br></div><div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">PRESSURE</span>

 = 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">inputs[0]</span>

.GetPointData().GetArray("

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">PRESSURE</span>

")</div></div><div>



<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">VELOCITY</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span></span>=<span> </span></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255);float:none;display:inline">inputs[0]</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>.GetPointData().GetArray("<span> </span></span>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">VELOCITY</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> </span>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span></span>")</span>

<br></div><div><br></div><div><br></div><div># Add this data to the file (you can use an interation here if you want to do add info comming from several slices)</div><div>FieldData=[X,Y,Z, PRESSURE, VELOCITY ] <br></div><div><div>with open(FilePath, 'a') as csvfile:</div><div>           filewriter = csv.writer(csvfile,lineterminator='\n')</div><div>           filewriter.writerow(FieldData)</div></div><div><br></div><div><br></div><div>I hope this will be useful.</div><div><br></div><div>Best regards,</div><div><br></div><div>Miguel </div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 2, 2018 at 8:05 AM, Caffagni, Andrea <span dir="ltr"><<a href="mailto:Andrea.Caffagni@ferrari.com" target="_blank">Andrea.Caffagni@ferrari.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-6819327489910829615WordSection1">
<p class="MsoNormal">Dear users,<u></u><u></u></p>
<p class="MsoNormal">I need to write in a .csv file some PointData from a slice.<u></u><u></u></p>
<p class="MsoNormal">I wrote my point values inside a ‘for’ cycle thus I would maintain only one .csv file and append each time the new data to this.<u></u><u></u></p>
<p class="MsoNormal">For this I have created the following commands in my script:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">                # create a new 'Pass Arrays'<u></u><u></u></p>
<p class="MsoNormal">                passArrays1 = PassArrays(Input=calculator7)<u></u><u></u></p>
<p class="MsoNormal">                UpdatePipeline()<u></u><u></u></p>
<p class="MsoNormal">                <u></u><u></u></p>
<p class="MsoNormal">                # Properties modified on passArrays1<u></u><u></u></p>
<p class="MsoNormal">                passArrays1.PointDataArrays = ['pressure', 'velocity']<u></u><u></u></p>
<p class="MsoNormal">                UpdatePipeline()<u></u><u></u></p>
<p class="MsoNormal">                <u></u><u></u></p>
<p class="MsoNormal">                # Create a new 'SpreadSheet View'<u></u><u></u></p>
<p class="MsoNormal">                spreadSheetView1 = CreateView('SpreadSheetView')<u></u><u></u></p>
<p class="MsoNormal">                spreadSheetView1.ColumnToSort = ''<u></u><u></u></p>
<p class="MsoNormal">                spreadSheetView1.BlockSize = 1024L<u></u><u></u></p>
<p class="MsoNormal">                # uncomment following to set a specific view size<u></u><u></u></p>
<p class="MsoNormal">                # spreadSheetView1.ViewSize = [400, 400]<u></u><u></u></p>
<p class="MsoNormal">                <u></u><u></u></p>
<p class="MsoNormal">                # export view<u></u><u></u></p>
<p class="MsoNormal">                ExportView('C:/Users/<wbr>acaffagni/Desktop/ciao.csv', ‘a’,view=spreadSheetView1)
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Unfortunately, the program stop itself at the ‘Properties modified on passArrays1’, without updating the pipeline.<u></u><u></u></p>
<p class="MsoNormal">Maybe it exists a more smart way to create this .csv file.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks a lot for the suggestions,<u></u><u></u></p>
<p class="MsoNormal">Andrea <u></u><u></u></p>
<p><u></u> <u></u></p>
</div>
<p>______________________________<wbr>______________________________<wbr>______________________________<wbr>_______________________</p>
<p> </p>
<p>Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può contenere informazioni che sono di natura privilegiata, confidenziale o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non è il destinatario designato,
 o il dipendente/agente responsabile per la consegna del messaggio al destinatario designato, si informa che ogni disseminazione, distribuzione o copiatura di questa comunicazione è vietata anche ai sensi della normativa vigente in materia di protezione dei
 dati personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.</p>
<p>______________________________<wbr>______________________________<wbr>______________________________<wbr>_______________________</p>
<p> </p>
<p>This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent
 responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is prohibited under the applicable data protection law. If you have received this e-mail by mistake,
 please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.</p>
<p> </p>
<p>______________________________<wbr>______________________________<wbr>______________________________<wbr>_______________________ </p>
</div>

<br>______________________________<wbr>_________________<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/<wbr>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/<wbr>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=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/paraview</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>
</div></div>