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!

Macro for Single Axis Pt-2-Pt Translation

Status
Not open for further replies.

jessie123

Automotive
Mar 29, 2004
3
Hello,
I am almost finished my first design in NX-3 and the only thing that I really miss from my old software is the ability to translate selected objects from point to point but only in one axis (for example ignoring the Y and Z values of the reference and destination points and just using the X values for the translation). By going Edit-Transform-Translate-To A Point and then selecting a reference point automatically advances you to the destination point prompt without the option to edit the specified reference point in order to zero out two of the values. Similarly, selecting a destination automatically advances you out of Point Constructor without the ability to edit the selected point. I tried capturing the routine in a macro, but have not had any success in re-assigning the XC,YC or ZC values to zero after the User Entry for the ref and dest point selection within the macro.
Any suggestions would be greatly appreciated.

JessieB
 
Replies continue below

Recommended for you

One workaround I know is to use the "stretch curve" command. If you are careful to pick the curves away from the endpoints it will move the curves rather than stretch them. Start the stretch curve command, pick your curves (be sure to pick away from the endpoints), choose point to point option. You will get the point constructor for ref and destination points; after you pick the destination point a dialog will pop up with the delta x, y, and z values. Zero out the values you don't want and press ok.
 
Thanks Cowski,
That works great for curves - if only the translate - point to point would come back with that panel that shows the resultant delta values of your reference and destination points I would be able to move solid bodies similarily.
 
It may be a pain, but you could do an info distance, copy the delta x and paste it into your translation command.
 
jessie123,

If you are trying to just move in one of the three main directions (XC, YC or ZC), try the following:

Edit -> Transform -> Translate -> Delta

This will give you a XC, YC, ZC dialogue that will allow you to input the value that you would like, along the vector that you would like, while having the other two vectors values remaining at zero. Please remember that these are in relation to your WCS as it is set at the time that you start the command. If you are going to create a MACRO utilizing this method, you will have to remember this fact, unless you incorportate moving the WCS within the MACRO.

I hope that this helps!

Chris Cooper
Cleveland Golf / Never Compromise
 
Thanks for the responses. I have been using the measure command to find the distance that I want to translate and then copy/pasteing the single axis value into the delta translate menu - I was just hoping to combine the two operations by using only one specified axis of the point-to-point move. Imagine how easy it would be to line-up the "Z" height of an object by just selecting it, dropping a point on the bottom of it and another anywhere in space at the desired "Z" height (regardless of X,Y) and then clicking OK. If I knew how to force the values to 0 of the XC and YC cordinates that are assigned when entering ref/dest points in a point-to-point translate macro, I would only be using the "delta Z" of the two points for my move.
 
Here is a grip program that will do a point to point translation of objects. It seems to work fairly well but hasn't been extensively tested, so use at your own risk. You will have to compile and link the following code.
Code:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$ PROGRAM PURPOSE: MOVE OBJECTS POINT TO POINT ALONG SELECTED AXES
$$ DESCRIPTION
$$ DATE, PROGRAMMER: JUNE 30, 2005
$$ SUBROUTINES USED: NONE

NUMBER/XREF,YREF,ZREF,XDEST,YDEST,ZDEST,DX,DY,DZ,RSP,TMAT(12),NUM
$$STRING/
ENTITY/OBJS(1000)

$$ MAIN PROGRAM
PKOBJ:
IDENT/'SELECT OBJECTS TO TRANSLATE',OBJS,CNT,NUM,RSP
JUMP/PKOBJ:,RESET:,,RSP

PKREF:
GPOS/'PICK REFERENCE POINT',XREF,YREF,ZREF,RSP
JUMP/PKREF:,RESET:,PKREF:,,,RSP

PKDEST:
GPOS/'PICK DESTINATION POINT',XDEST,YDEST,ZDEST,RSP
JUMP/PKDEST:,RESET:,PKDEST:,,,RSP

DX=XDEST-XREF
DY=YDEST-YREF
DZ=ZDEST-ZREF

PKDIR:
CHOOSE/'MOVE OBJECTS ALONG...',$
  'X',$
  'Y',$
  'Z',$
  'X AND Y',$
  'X AND Z',$
  'Y AND Z',$
  RSP
JUMP/PKDIR:,RESET:,,,XDIR:,YDIR:,ZDIR:,XYDIR:,XZDIR:,YZDIR:,RSP

XDIR:
TMAT=MATRIX/TRANSL,DX,0,0
JUMP/CONT:

YDIR:
TMAT=MATRIX/TRANSL,0,DY,0
JUMP/CONT:

ZDIR:
TMAT=MATRIX/TRANSL,0,0,DZ
JUMP/CONT:

XYDIR:
TMAT=MATRIX/TRANSL,DX,DY,0
JUMP/CONT:

XZDIR:
TMAT=MATRIX/TRANSL,DX,0,DZ
JUMP/CONT:

YZDIR:
TMAT=MATRIX/TRANSL,0,DY,DZ
JUMP/CONT:

CONT:
TRANSF/TMAT,OBJS(1..NUM),MOVE

$$ END OF MAIN PROGRAM
JUMP/RESET:

RESET:
$$ RESET INITIAL PARAMETERS

HALT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor