# Reading a binary vtk file with multiple scalars

**URL:** https://discourse.vtk.org/t/reading-a-binary-vtk-file-with-multiple-scalars/6936
**Category:** Support
**Tags:** file-formats
**Created:** [October 22, 2021, 10:17am UTC](https://discourse.vtk.org/t/reading-a-binary-vtk-file-with-multiple-scalars/6936 "2021-10-22T10:17:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Procyon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/ac91a4/32.png) [@Procyon](https://discourse.vtk.org/u/Procyon)
#### Post date: [October 22, 2021, 10:17am UTC](https://discourse.vtk.org/t/reading-a-binary-vtk-file-with-multiple-scalars/6936/1 "2021-10-22T10:17:36Z")

</div>

Hello,

I am trying to read a binary vtk file using vtkGenericDataObjectReader, but it reads only the first scalar, even when i call ReadAllScalarsOn(). Here is my Python code:

```auto
theFilename = 'StaticMixer_001_VTK\DefaultDomain.vtk'
import vtk
import math
reader = vtk.vtkGenericDataObjectReader()
reader.SetFileName(theFilename)
reader.ReadAllScalarsOn()
reader.Update()
print(reader.GetScalarsNameInFile(0)) # Absolute_Pressure
print(reader.GetScalarsNameInFile(1)) # None
scalar_names = [reader.GetScalarsNameInFile(i) for i in range(0, reader.GetNumberOfScalarsInFile())]
print(scalar_names) # ['Absolute_Pressure']
print(reader.GetNumberOfScalarsInFile()) # 1

```

When I open the exact same file in ParaView, it finds all variables, scalars and vectors. When the VTK file is in ASCII, all variables are found.

What did I do wrong?

Sincerely,  
Procyon
