hexagon logo

How to solve py_post.IndexError: Node scalar at 5 does not exist?

I have a python program to obtain contact_status from nodes (I use p.node_scalar(i,j)) in the surface of a .t16 model.
I am using version 2019.
Node scalar 5, is the contact status. However changing this number continues showing the error...
 
I keep obtaining the error mentionned above, can anyone help me fixing the error?
 
Thak you very much!
 
Parents
  • You are probably using the incorrect index for the extraction of the contact status. A simple way to confirm this, and to find out the correct index, is to add this snippet of code somewhere in the routine:
     
       nns = p.node_scalars()
       print("Found ", nns, " node scalars ")
       for j in range(0, nns):
           print ("index: ",j," label: ", p.node_scalar_label(j))
     
    The correct index is likely 15.
Reply
  • You are probably using the incorrect index for the extraction of the contact status. A simple way to confirm this, and to find out the correct index, is to add this snippet of code somewhere in the routine:
     
       nns = p.node_scalars()
       print("Found ", nns, " node scalars ")
       for j in range(0, nns):
           print ("index: ",j," label: ", p.node_scalar_label(j))
     
    The correct index is likely 15.
Children
No Data