×
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

Instances translation problem.

Instances translation problem.

Instances translation problem.

(OP)
I am trying to script an assembly.

So far I can import the separate parts (each of which has its own reference point) into the assembly & translate them to a specific point.

In CAE you can select a point on the instance & translate that point to a given coordinate but I have found no way of doing this via the Python API.

I can get access to an instances reference point's coordinates within the assembly easy enough with,

CODE --> Python

instRefCoords = mdb.models['Model-1'].rootAssembly.getCoordinates(mdb.models['Model-1'].rootAssembly.instances['TESTCASE_1-1'].referencePoints[4]) 

But when I look at the translate command it only has an instance list & an end point,

CODE --> Python

mdb.models['Model-1'].rootAssembly.translate(instanceList=('TESTCASE_1-1', ), vector=(endPoint)) 

Anyone know a way of doing this?

RE: Instances translation problem.

The Scripting Reference Guide says, that the final vector is used in the command. A end point defines a vector, when the first point is the origin.

I think it should be easy for you to calculate the vector by yourself and then use it within the command.

RE: Instances translation problem.

(OP)
My issue is when the instance is placed which part of the instance is being used as a reference as you cant pick a point with the API?

Is it the vertex-centroid of the instance?

RE: Instances translation problem.

It doesn't matter. The translation vector is the same for every point on the instance. There is no deformation in that process.

RE: Instances translation problem.

(OP)
Yes but when the instance is placed at the origin which part of the instance is actually at the origin?

Because that will affect the position of the part once translated eg if the corner of a box was at the origin it would be translated to different place then if the box's centroid was at the origin.

RE: Instances translation problem.

Quote:

Yes but when the instance is placed at the origin which part of the instance is actually at the origin?

That question is not correct. A instance cannot be at the orgion. Only one point of the instance could be at the origin.

Is your problem, that you don't know anything of your initial instance position at the beginning, so you don't know what translation vector is necessary?

RE: Instances translation problem.

(OP)
Yes exactly that.

RE: Instances translation problem.

Then is sounds as you can't solve that with pure scripting.
Scripting requires certain consistency in the process or rules that can be applied when specific things are fulfilled.

You could check all points, edges or faces for their coordinates or center, but then you need to do something with these informations.
If that is not possible, then you can maybe split the process into a manual task and an automated task.

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