[Paraview] Setting the representation to Volume doesn't work in Python script.

Junyi Han demonmerlin at gmail.com
Mon Nov 25 15:09:46 EST 2013


Hi all,

I want to set the representation to 'Volume' instead of 'Surface'. But the
result shows the representation is still the 'Surface' after I modified my
code as shown below. Thanks ahead for any help!

Best wishes,
Junyi Han


CODE:

    reader = OpenDataFile(VTKFile)
    reader.PointData
    view = GetRenderView()

    dp = GetDisplayProperties()
    dp.Representation = 'Volume'
    lut = CreateLookupTable()
    lut.RGBPoints  = [0.0, 0.0, 0.0, 1.0,
                        3.3, 1.0, 1.0, 1.0,
                      6.674, 1.0, 0.0, 0.0]

    readerRep = GetRepresentation()
    readerRep.ColorArrayName = 'scaler_name'
    readerRep.LookupTable = lut

    Show(reader)
    Render()

# Get a nice view angle
    if count == 0:
        cam = GetActiveCamera()
        cam.Elevation(30)
        cam.Azimuth(30)
        Render()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20131125/c55cfe28/attachment.htm>


More information about the ParaView mailing list