Hello
I am trying to Extract a selection of points (along a line) from a vtk block. The first part went relatively easy identifying the indices of the points I want to extract. This is what I did
YToFind = 50.
ZToFind = 0.
plx_path=r"C:\Users…"
phaseNb = 5
nameFile = plx_path+r"\1_"+str(phaseNb+1)+“0_Phase”+str(phaseNb)+"[Phase_"+str(phaseNb)+"]_nodal.pvd"
nodalPvd = PVDReader(FileName=nameFile)
GetactiveSource = GetActiveSource()
vtkBlock = paraview.servermanager.Fetch(activeSource)
vtkSource = vtkBlock.GetBlock(1).GetBlock(0)
pointsData = vtkSource.GetPointData()
nPoints = vtkSource.GetNumberOfPoints()
-
*
IDSelection = []
for i in range(0, nPoints):
point = vtkSource.GetPoint(i)
if ((point[1] - YToFind)**2) < 1e-12 and ((point[2] - ZToFind)**2) < 1e-12:
IDSelection.append(i)
But then it became problematic as the FindData s does not issue the complete set of command in combination with Tracing
For instance I tried this
Qstring = '((id == ‘+str(IDSelection[0])
for i in IDSelection[1:]: Qstring = Qstring + ’ | ( id == ’ +str(i)+ ’ )’
Qstring = Qstring + ‘)’
QuerySelect(QueryString=id, FieldType=‘POINT’, InsideOut=0)
But this is not working as there are two blocks in my data and only block 2 should be considered and despite me specifying block 2 in the Find data dialog box, it does not generate the corresponding command and I am no clue on how to code it myself?
Any clue?
Thank you