I am trying to pass the arrays data from a PlotOnSortedLines1 filter (where I applied previously a Merge Blocks filter) to python using the following approach:
FindSource1 = FindSource(‘PlotOnSortedLines1’)
data = paraview.servermanager.Fetch(FindSource1).GetBlock(0)
rc_length_vect[0] = block.GetPointData().GetArray(‘arc_length’).GetValue(0)
But I get the following error: AttributeError: ‘vtkmodules.vtkCommonDataModel.vtkMultiBlockDataSet’ object has no attribute 'GetPointData’
About the variable types:
FindSource1
<paraview.servermanager.PlotOnSortedLines object at 0x7efd9ec527c0> data
(vtkmodules.vtkCommonDataModel.vtkMultiBlockDataSet)0x7efd96723f40
How could I pass the data from a MultiBlockDataSet to python?
So I am trying to access to a Multi-block Dataset in my code, which looks like the following:
data = paraview.servermanager.Fetch(organised_surf_data) #*
block = data.GetBlock(0)
for i in range(npoints):
arc_length_vect[i] = block.GetPointData().GetArray('arc_length').GetValue(i)
data_pnt_idx = block.GetPoint(i)
#* Note that the filter “Organised Surf. data” from the pipeline that I want to access is called “organised_surf_data” in my python code.
So when I execute the above code in parallel (with multiple CPUs) I get the following error : AttributeError: ‘vtkmodules.vtkCommonDataModel.vtkMultiBlockDataSet’ object has no attribute 'GetPointData’
How could I avoid this problem when running the script in parallel? (it works perfectly in serial)
I’m sorry for the delay with reply. If it is still actual, could you please print out the type of block object. Something like this:
data = paraview.servermanager.Fetch(organised_surf_data) #*
block = data.GetBlock(0)
print(type(block)) # <<<
for i in range(npoints):
arc_length_vect[i] = block.GetPointData().GetArray('arc_length').GetValue(i)
data_pnt_idx = block.GetPoint(i)
And then check the ‘Output Messages’ window in PV client and check the output in remote terminal with pvserver. Thanks.