Macro for Single Axis Pt-2-Pt Translation
Macro for Single Axis Pt-2-Pt Translation
(OP)
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
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





RE: Macro for Single Axis Pt-2-Pt Translation
RE: Macro for Single Axis Pt-2-Pt Translation
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.
RE: Macro for Single Axis Pt-2-Pt Translation
RE: Macro for Single Axis Pt-2-Pt Translation
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
www.clevelandgolf.com
www.nevercompromise.com
RE: Macro for Single Axis Pt-2-Pt Translation
RE: Macro for Single Axis Pt-2-Pt Translation
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