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!

UG GRIP expert opinion for repositioning 1

Status
Not open for further replies.

shimuk

Mechanical
Jul 5, 2007
8
I was wondering if anyone knows how to do an object repositioning in UG using GRIP. More specifically, I would like to write the required code in GRIP so I can reposition one object using the CSYS to CSYS. I know how to write and use GRIPs, however I didn't find the dedicated system routine(s) to do the repositioning the way I need.
 
Replies continue below

Recommended for you

Transformations in GRIP are performed using a transformation matrix. What you will need to do is determine the matrix that it will take to move something from one reference CSYS to another. I would start with the matrix command. Now some this may sound confusing but I found an error in the GRIP documentation, but bear with me on this one.

Open the User Documention and go to the NX/Open section and search on both 'transform' and 'matrix' and review some of the pages there so that you can become familiar with how this works. Now you will need to create a matrix representing the destination CSYS, so now search on 'coordinate system' and select the reference titled 'Coordindate System'. Now here's teh confusing part, even though the page is labled correctly and it does talk about how to get the matrix values of a CSYS, the illustration of the example is all wrong, but don't dispair as I found it. So after reviwing (printing out the page) now go and search on 'lnarrw' (trust me, this will take you to where you need to go). When the search results come up select the SECOND 'Line Between Arrows Example' reference (I said it was confusing, but we're almost there) and you will find the missing illustration of the CSYS matrix example.

Anyway, this should get you going in the right direction, once you figure out where the proper illustrations are located ;-)

BTW, I've opened a PR to fix the illustrations and since this is just a 'Cut & Paste' job, it shouldn't be a problem.



John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
 
Hi,
Thank you for your feedback. I have to tell you that I know about transformation matrices in GRIP. The problem I have though is that I don't need to do just a simple translation but a repositioning which implies also rotations. While the translation values are not difficult to calculate (between two CSYS) and in consequence to create the Translation Matrix, the difficulty appears when I need to obtain the rotations between the two CYCS. I know that you can create a Rotation Matrix and a combination of matrices. But how do I "read" the angular position o the new CSYS without going to complicated calculations for Euler angles and so on? I was hoping that there is a short-cut in GRIP to emulate the CSYS to CSYS reposition (similar to how normally this is done in UG: through EDIT/Transformation/Reposition/CYCS to CYCS).
 
OK, this might look like killing flies with a sledge hammer, but give it a shot.

First perform an EXPORT, to a dummy part file, of the object(s) you wish to transform relative to CSYS1, then IMPORT said dummy part file back in relative to CSYS2.

Just search on 'export' and 'import' to find all the relavent information for the 'Export Part' and 'Import Part' commands. If you wish to perform a MOVE instead of a copy, you will have to delete the original objects after the EXPORT. Also, don't forget to delete the dummy part file out on the disk before you exit the program.

This is probably to easiest solution to your problem.



John R. Baker, P.E.
Product 'Evangelist'
UGS NX Product Line
SIEMENS
UGS PLM Software
Cypress, CA
 
Thank you again!

I will try this method soon. It looks that is going to work by looking to what is the synopsis for the CPATT and RPATT:)
 
I have checked the repositioning method using CPATT and RPATT. It works great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor