×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

XYZ node coordinates to txt file in a particular fashion

XYZ node coordinates to txt file in a particular fashion

XYZ node coordinates to txt file in a particular fashion

(OP)
Hi everyone,

I have started using Abaqus and Python today so the question might sounds a bit simple for some of you...
I am trying to extract the x y z node coordinates of every face in my tet mesh in order to print them out to a txt file.

So far I have managed to get the Node's coordinates of a particular face but I do not know how to extrapolate this logic to every face in order to get the txt file type I am looking for. This is what I have done to get the nodes coordinates:

p=mdb.models['Model-1'].parts.values();
part=p[0];
print len(part.faces);
f = part.faces[31];
print f.getElementFaces();
f.getElementFaces()[0].getNodes();
print f.getElementFaces()[0].getNodes()[0].coordinates;

My aim is to get a txt file including the "N" faces in the following fashion:

#FACE 0
#all the coordinates in FACE 0
956.676 154.61 -283.01, #point 0
953.673 154.61 -283.005, #point 1
956.666 68.6142 -315.087, #point 2
953.677 68.6222 -315.095, #point 3
956.669 -22.9358 -321.654, #point 4
953.67 -22.9378 -321.66, #point 5
#all the triangles in FACE 0
0 1 2, #triangle 1 (connects points 0 1 2)
2 1 3, #triangle 2 (connects points 2 1 3)
4 3 5, #triangle 3 (connects points 4 3 5)

#FACE 1
.
.
.
#FACE N

I would be grateful if you could give me a hand scripting this.

Many thanks!

RE: XYZ node coordinates to txt file in a particular fashion

I would do it a different way, which is much easier in my opinion:
Put each face in a set in CAE, mesh it and write out the input file. Now you'll find all informations there - a elset for each set/face and a node set for each set/face in the .inp. You just have to read that with a script and write it with a desired format into another file.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources