<div dir="ltr"><div>The problem appears to be that SetUpdateTimeStep helper method on the vtkAlgorithm was not wrapped in python for some reason so you can't get it directly from reader (or any other algorithm).<br><br>This is the vtk 6.3 python API.<br><br></div><div>reader.UpdateInformation()<br>outinfo = reader.GetExecutive().GetOutputInformation(0)<br>infkey = vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP()<br>outinfo.Set(infkey, 0.5)<br></div><div>reader.Update().<br></div><div><br>And no worries about being new to VTK, even for an old timer like me it took me some head scratching to figure it out. <br><br>Yet another reason to try 7.1 if you can. The new API is just:<br></div><div>reader->UpdateTimeStep(0.5)<br></div><div><br></div><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Thu, Nov 3, 2016 at 7:21 AM, Timofey Mukha <span dir="ltr"><<a href="mailto:timofey.mukha@it.uu.se" target="_blank">timofey.mukha@it.uu.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>Dear David,</p>
<p>Thank you for the fast reply! I am trying to use your tip, but
since I am very new to VTK it is not working out well for me.</p>
<p>Could you elaborate a bit, what would "anAlgorithm" be. A child
to vtkAlgorithm? The thing is none of the objects I create seem to
have the SetUpdateTimeStep() as a member. Browsing doxygen made me
think that it is a member of vtkStreamingDemandDrivenPipeli<wbr>ne, is
that something I should have in the script?</p>
<p>Kind regards,</p>
<p>Timofey<br>
</p><div><div class="h5">
<br>
<div class="m_-1322253718752300498moz-cite-prefix">On 2016-11-02 18:40, David E DeMarle
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>In vtk 6.3 it was:<br>
anAlgorithm->UpdateInformation<wbr>();</div>
anAlgorithm->SetUpdateTimeStep<wbr>(0.5);
<div>anAlgorithm->Update();<br>
</div>
<div>Try that.<br>
<br>
</div>
<div>In vtk 7.1 it is:<br>
</div>
<div>anAlgorithm->UpdateTimeSep(0.<wbr>5);<br>
</div>
<div>Since Berk cleaned up the parts of the pipeline that caused
issues like you are seeing.<br>
<br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="m_-1322253718752300498gmail_signature" data-smartmail="gmail_signature">David
E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div>
</div>
<br>
<div class="gmail_quote">On Wed, Nov 2, 2016 at 12:43 PM,
Timofey Mukha <span dir="ltr"><<a href="mailto:timofey.mukha@it.uu.se" target="_blank">timofey.mukha@it.uu.se</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
I am trying to write a python script for doing some stuff
with an OpenFOAM case. Everything works great, except that I
can't choose the time-value that I want the reader to get
the data for.<br>
<br>
I have found the SetTimeValue() function which is supposed
to do the job I think, but it doesn't -- the first availbale
time-value is always used. Here is how I use the reader:<br>
<br>
reader = vtk.vtkOpenFOAMReader()<br>
reader.SetFileName(path)<br>
reader.CreateCellToPointOff()<br>
reader.DisableAllPointArrays()<br>
reader.Update()<br>
print(vtk_to_numpy(reader.GetT<wbr>imeValues())) # Grab the
available timesteps<br>
reader.SetTimeValue(vtk_to_num<wbr>py(reader.GetTimeValues())[-1]<wbr>)
# Try to load the latest time<br>
reader.Update()<br>
<br>
I use the version provided by the Anaconda python disstro,
6.3.0 I believe.<br>
<br>
Thanks in advance,<br>
<br>
Timofey<br>
<br>
<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/opensou<wbr>rce/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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>