Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating edge and node sets in Abaqus using Python

Status
Not open for further replies.

gokul8707

Automotive
Nov 28, 2015
14
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
 
Replies continue below

Recommended for you

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().
 
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?
 
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')
 
Choosing faces works fine with "findat" command. But not with edges.. Dono the reason though
 
Ahh, sorry, mixed faces with edges. I will post something correct soon.
 
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')
 
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
 
Hi Mustaine

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

Thanks
 
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.
 
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
 
 http://files.engineering.com/getfile.aspx?folder=1d95cf9d-545c-4dd7-9e39-b048477eb1bf&file=Alu_part1_03_11_15.stp
A nd i would like to have my surfaces in the assembly module..
 
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.
 
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?
 
 http://files.engineering.com/getfile.aspx?folder=aebd148c-9fca-40b7-ab50-6dcff0e7577e&file=test1.cae
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')
 
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).
 
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
 
Hi mate..
Setbyboolean helped me...
Thanks..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor