Ok, that helps for a possible solution. Thanks!
With

writer = CreateWriter('sol_i=0.vtm')
writer.UpdatePipeline()

I get an XML file, that can be loaded back into ParaView.
---
Still the behaviour I noticed before remains strange.

I used the extension ".vtk". From the GUI, I chose "Save Data", and then "Legacy VTK Files(*.vtk)", which should be a valid option, because it is explicitly offered. The pvpython commands were

writer = DataSetWriter(slice)
writer.FileName = 'sol_i=0.vtk'
writer.FileType = "Ascii"
writer.UpdatePipeline()

The result of both is the same, i.e. a file with the following structure:

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET MULTIBLOCK
CHILDREN 96
CHILD 0
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 39714 float
...
POLYGONS 77132 308528
...
POINT_DATA 39714
...
ENDCHILD
CHILD 0
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 219146 float
...
ENDCHILD
CHILD 0
...
ENDCHILD
...

Each part between "CHILD 0" and "ENDCHILD" would be a complete Legacy VTK file in itself.
The ParaView version is 3.14.1.

By the way, when I use

writer = CreateWriter('sol_i=0.vtk')

I get the following error message:

ERROR: In [...]\src\ParaViewCore\ServerManager\vtkSMWriterFactory.cxx, line 374
vtkSMWriterFactory: No matching writer found for extension: vtk

Is ".vtk" not a valid file extension?



Am 28.11.2012 19:55, schrieb Sebastien Jourdain:
There is no multi-block legacy format. What file extension did you try
to write ? It should be .vtm by default.



On Wed, Nov 28, 2012 at 11:52 AM, Ian Krukow
<i.kru...@tu-braunschweig.de <mailto:i.kru...@tu-braunschweig.de>> wrote:

    Hi,

    I have loaded an EnSight file (results from an external code) into
    ParaView, taken a slice from it and saved it in Legacy VTK format.
    The result is a VTK file with multiblock datasets. When I try to
    load it again, ParaView does not recognise the file format and asks
    me to choose a reader. Why does ParaView not know the format of a
    file, that it has written itself?

    The written VTK file contains several "CHILDREN" with part of the
    data (I suppose that it is just divided) plus several empty
    CHILDREN. If I put the data of a single CHILD into a seperate file,
    I can load it into ParaView without any problems.
    Now, I could manipulate the file "by hand" (or script), so that I
    get a file I can use again in ParaView, but I just do not think,
    that this is the way it is supposed to be. Can somebody help me?

    Best regards
    Ian
    _________________________________________________
    Powered by www.kitware.com <http://www.kitware.com>

    Visit other Kitware open-source projects at
    http://www.kitware.com/__opensource/opensource.html
    <http://www.kitware.com/opensource/opensource.html>

    Please keep messages on-topic and check the ParaView Wiki at:
    http://paraview.org/Wiki/__ParaView <http://paraview.org/Wiki/ParaView>

    Follow this link to subscribe/unsubscribe:
    http://www.paraview.org/__mailman/listinfo/paraview
    <http://www.paraview.org/mailman/listinfo/paraview>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to