Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Automated way of exporting coordinates (X,Y,Z,R,P,Y) of certain components in an assembly

Status
Not open for further replies.

please_dont_crash

Automotive
Apr 21, 2020
25
Hi all,

Let me preface this by saying that I have almost no NX knowledge, so please don't be surprised if I'm asking for something obvious, or I don't even know basic NX terminology.

My goal is to have a script within NX that, when run, will go through an assembly, and export the (x,y,z) and (r,p,y) coordinates of specific parts of the assembly into a text file. The point of this script is to provide me with a quick way to get the coordinates of these parts, as they are currently changing a lot during development, and I need their coordinates for other uses. Getting these coordinates by hand is incredibly time-consuming.

The way I imagine this happening, is that I add a specially-named element to each of these bits of the assembly (a datum? A coordinate system?), and the script traverses the assembly tree looking for these specific elements, grabs the coordinates, and puts them in a file, hopefully with a column that identifies what each entry corresponds to.

What complicates matters is that these parts are not mated; they are currently free-floating and positioned by hand.

It's OK if the script has to be changed if one of these parts is deleted or another is added. In fact, I would expect that.

So what do you think? How would I go about this? What should I google and learn about?

EDIT:
Plan B is some way of making this (X,Y,Z,R,P,Y) information clearly visible for these specific parts somewhere in the NX interface. Something that can be easily selected, copied, and pasted somewhere else, without having to go through extra windows, click buttons, that sort of thing.

Thank you!
 
Replies continue below

Recommended for you

I'm familiar with (X,Y,Z) notation, but what is (R,P,Y) w.r.t. coordinate systems?

If you run the information -> object command and select a component, the information window will give you the (X,Y,Z) coordinates and a rotation matrix showing how the component has been repositioned. The 2 threads listed below have some code that deals with component positions. I don't think either does exactly what you are looking for, but they might be a good start.

thread561-344785
thread561-311299

www.nxjournaling.com
 
Sorry it took me a while to reply!

cowksi said:
I'm familiar with (X,Y,Z) notation, but what is (R,P,Y) w.r.t. coordinate systems?

I believe this approach is called Tait-Bryan angles (roll, pitch, yaw). In other words, the object's position is specified by first placing it in a nominal orientation in the assembly, for example with its X axis aligned with the global X axis. Then you rotate the object around the global X axis (roll angle), then around the global Y axis (pitch), and finally around the global Z axis (yaw).

Note that this may note have been the exact sequence of actions that resulted in the object's final position. It's just a standard way of describing the transformations that result in the final positions.

That said, I can always figure out how to convert whatever angles I can get from NX into this RPY format outside of NX.

cowski said:
thread561-344785: Get Component Rotation Angles

Wow that looks exactly like what I need! Now I'll go off and learn how to run this code. And I just noticed your journaling website. It looks like this will be my first stop.

Thank you! I'll very likely be back with more questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor