×
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

Creating edge and node sets in Abaqus using Python

Creating edge and node sets in Abaqus using Python

Creating edge and node sets in Abaqus using Python

(OP)
Hi guys

I have not much experience in Python scripting for Abaqus. I am importing an step file from catia to Abaqus. I want to create edge and node sets for applying boundary conditions. I came across an "findat" option to do it.. But i am not successful with it.

Is there any other option of selecting specific nodes at specific edges to form a set in abaqus?

assembly = mdb.models['Upper_Rail'].rootAssembly
assembly.Set(edges=assembly.instances['al_part'].edges.findAt(((308.044891, -747.636108, 669.81366),),), name='fixed_edge')
assembly.Set(name='fixed_nodes', nodes=assembly.sets['fixed_edge'].nodes)

The coordinates is the starting point of the edge which i need to select.
i get an error

Warning: findAt could not find a geometric entity at (308.044891, -747.636108, 669.81366)
REg
Gokul

RE: Creating edge and node sets in Abaqus using Python

Go into the Assembly-Module and create a datum point with these coordinates and check where he appears. This will give you an optical feedback if your coordinates are correct.

If your coordinates are not precise enough, you could use getClosest().

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi Mustaine3

I did this the place i want to create the sets are the exact one. But how do i say abaqus to select the edge which starts from this coordinate?

RE: Creating edge and node sets in Abaqus using Python

I've just built a testblock and it worked fine.

i = mdb.models['Model-1'].rootAssembly.instances['Part-1-1']
print i.faces.findAt((1,0,0),)

({'featureName': 'Part-1-1', 'index': 5, 'instanceName': 'Part-1-1', 'isReferenceRep': False, 'pointOn': ((9.166667, -4.166667, 0.0),)})

And creating a set:
x=i.faces.findAt((1,0,0),)
edges1 =i.edges[x.index:x.index+1]
mdb.models['Model-1'].rootAssembly.Set(edges=edges1, name='Set-1')

RE: Creating edge and node sets in Abaqus using Python

(OP)
Choosing faces works fine with "findat" command. But not with edges.. Dono the reason though

RE: Creating edge and node sets in Abaqus using Python

Ahh, sorry, mixed faces with edges. I will post something correct soon.

RE: Creating edge and node sets in Abaqus using Python

a = mdb.models['Model-1'].rootAssembly
i = a.instances['Part-1-1']
x = i.edges.findAt((1,0,0),)
edges1 =i.edges[x.index:x.index+1]
a.Set(edges=edges1, name='Edge-Set-1')

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi mustaine3

Still it doesnt work fine with this "findat" command. Especially this line

x = i.edges.findAt((1,0,0),)

when i give my coordinates it doesnt have any geometric entity in it.. I am trying to find it using an "getbyboundingbox" command.

Thanks

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi Mustaine

Any idea on how to select the faces using python..? have tried it with many options not working out though..

Thanks

RE: Creating edge and node sets in Abaqus using Python

It depend on the informations you have of that face. You probably don't have the ID of that face, but you should know some specific about it's location.

- if you know exactly the location, then you can use findAt()
- if you know an approximate location, you could use getClosest()
- searching by a bounding box or sphere is similar
- or you know that this face is the outer/innermost face of the structure in a direction, then you could cycle through all faces and check each pointOn() information

I can create an example script, but not without more information of your specific problem. So if you're interested, upload a CAE file with a part/instance and mark the face (with a set, i.e.) you would like to access via Python. Then I could script how to do that.

PS: And let me know if it should be done at part or assembly level and what information of that face you have in advance.

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi mustaine

Thanks for ur help.. Actually i am using a .stp file imported from catia. So i will upload the .stp file to you. Because i am not sure whether i can use all the features of Python with imported parts. I hope u can just create a surface using python . Thanks a lot mate. I have also attached a picture showing the surface i want to select.

Reg
Gokul

RE: Creating edge and node sets in Abaqus using Python

(OP)
A nd i would like to have my surfaces in the assembly module..

RE: Creating edge and node sets in Abaqus using Python

And what information do have in advance that can be used with a script? A script cannot look at the part and use a visual information, so there needs to be a specific criteria that enables the identification of that face. I've listed some possibilities in my last post.

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi mustaine.. i have the coordinates of a point on the face , but when i use findAt() command it doesnt detect the face at that point.. Best way i will send my CAe file to you. As i preprocessed my part in catia i am not able to find out any informations in my part in abaqus.

And also i am finding the coordinates of the points in the part by writing a input file prior to the analysis, so that i can get the coordinates at certain locations. Is there any way to also see what informations that can be got just from the part imported from Catia.

When i use the keywrods like, getnodes(), getedges(), getfaces() i am not able to see anything. How to see in prior what infos i have in my part?

RE: Creating edge and node sets in Abaqus using Python

There you go.

But with the coordinates from your first post you'll not get the face you want. The other face seems to be closer.

#your coordinates = 308.044891, -747.636108, 669.81366
#geometry vertex between faces = 308.044876,-747.636108,669.81366

In general it is not a good idea to use a coordinate where it is not clear which face is the closest.


CODE

from abaqus import *
from abaqusConstants import *

a = mdb.models['Model-1'].rootAssembly
i = a.instances['al_test-1']
found_faces = i.faces.getClosest(coordinates=((308.044891, -747.636108, 669.81366),))
face_index = found_faces[0][0].index

side1Faces1x = i.faces[face_index:face_index+1]
a.Surface(side1Faces=side1Faces1x, name='Surf-x') 

RE: Creating edge and node sets in Abaqus using Python

And I've forgot: findAt() is not working, because your coordinates are too far away from any surface. The tolerance with findAt() is really small (1e-6).

RE: Creating edge and node sets in Abaqus using Python

(OP)
Thanks a lot mate.. Have to learn a lot from the scripting.. I have another doubt . I have 2 node sets created in part level. Is it possible to put those 2 sets as a single set of nodes in assembly level. Cant able to find any keywords doing it.

Thanks

RE: Creating edge and node sets in Abaqus using Python

Select them both in the tree > Rightclick > Merge

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi mate..
Setbyboolean helped me...
Thanks..

RE: Creating edge and node sets in Abaqus using Python

(OP)
Hi mate..
Is it possible to give a raw input to abaqus from python script.. I would like run my script having a raw input command to choose the material of the users choice. I am having a array of material values and i want abaqus to prompt whenever i run my script for materials

Think i have put it clearly to you.

Thanks

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