0

I am checking the elements beneath a surface for their labels & the coordinates of their nodes in the following code,

mySurf = mdb.models['Model-1'].rootAssembly.surfaces['Surf-1']
surfEls = mySurf.elements[:]

surfNodes = []
for eNode in mySurf.nodes:
    surfNodes.append(eNode.coordinates)

This does something but when I check the sizes of each list then I get more element labels than I do sets of node coordinates!

I also tried the following to get the nodal coordinates,

surfNodes = mySurf.nodes[:]
surfNodesCoords = surfNodes.coordinates[:]

But this just throws up an error,

AttributeError: 'MeshSequence' object has no attribute 'coordinates'

Which I confess has dumbfounded me. Does anybody have a deeper understanding of the methods used above, who can explain this behaviour to me?

DrBwts
  • 3,470
  • 6
  • 38
  • 62
  • i don't follow, are you confused that the number of elements doesn't match the number of nodes? – will Jul 07 '16 at 16:14
  • No I've worked that out now, what is bugging me is though is when & when you cant use the slice notaion – DrBwts Jul 08 '16 at 13:44
  • can you edit your question to clarify please. your appended list contains a bunch of a abaqus types. if you update your question then maybe we can help – will Jul 08 '16 at 18:48

1 Answers1

1

The problem is that the MeshSequenceObject does not have method 'coordinates'. However, a member of MeshSequenceObject may have this method, if sequence contains nodes. Just apply it to each member of the sequence:

surfNodesCoords = [Node.coordinates for Node in SurfNodes]

The latter will make the list with coordinates of all nodes.

P.S. The first part of the question is working fine. The number of nodes is bigger than the number of elements.

nikolay-pv
  • 76
  • 3