×
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

PScripting-find an edge between a lot of parts

PScripting-find an edge between a lot of parts

PScripting-find an edge between a lot of parts

(OP)
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????

RE: PScripting-find an edge between a lot of parts

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.

RE: PScripting-find an edge between a lot of parts

(OP)
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??

RE: PScripting-find an edge between a lot of parts

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.

RE: PScripting-find an edge between a lot of parts

(OP)
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?

RE: PScripting-find an edge between a lot of parts

You could use findAt() at those vertices. Then you have their IDs and can do whatever you want with them.

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