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!

PScripting-find an edge between a lot of parts 1

Status
Not open for further replies.

MrzKamali

Geotechnical
Sep 7, 2017
4
For the ABAQUS Experts out there,
I have written a python script that generate some edges and faces and assembled them as independed instances. I want to find a instance by findAt(x,y,z). So I used below code as abaqus documentation to create an EdgeArray to be able to search between them:


EDGES=mdb.models['Model-1'].rootAssembly.allinstances.edges

but got an error as this:

AttributeError: 'Assembly' object has no attribute 'allinstances'

I tried allinstances by capital I (allInstances) as below:

EDGES=mdb.models['Model-1'].rootAssembly.allInstances.edges

and the error was:

AttributeError: 'Repository' object has no attribute 'edges'

in another try I used:

EDGES=mdb.models['Model-1'].rootAssembly.edges

however there is no error in this situation, but the array of EDGE is empty; is there any suggestion????

 
Replies continue below

Recommended for you

You have to use an instance. Use .keys() to generate a list of instances and then a for loop to cycle through them and use findAt() in it.
 
Thank you Mustaine3
Actually I have a lot of instances as wire. I'm trying to find any wire instances along path and between two vertices. However the method that you said before is working, but looping all instances to find an instance by findAt() and using a point middle of two vertices, is really time consuming. in other hand, if the line between two vertices included of instances more than one, it returns just one of them. is there any better method or idea??
 
The performance issue is something you have to solve (or live with).

When multiple lines might be found, then you can check the outcome of each findAt() (maybe with len()) and append the instancename to a previously created list.
 
Line don't lying in each other and one of the problems is that what coordinate should I get to findAt(). actually the line's lengths and number of them is unknown and only the coordinates of two vertices is known. is there any way that I could select them for example by session commands?
 
You could use findAt() at those vertices. Then you have their IDs and can do whatever you want with them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor