Avoid point relative command when moving points a fixed distance

Started by bdeck, June 19, 2026, 06:53:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bdeck

Here's a simple way to move selected points a fixed xyz distance without the added complexity of the Point Relative command. (If all points in the selection are selected points, this command can be used to move the entire selection.)


'  pm.d3m       points move        bdeck    11/2018

'  Macro to move a set of selected points by a user-input displacement
'  Adapted from SETSELECTEDPOINTS demo in SDK Macro Language Reference Manual
'  This version has a built-in verify/undo feature that does not disrupt the point selection

'  1) select one or more entities
'  2) drag select one or more points on the selection
'  3) run the macro
'  4) input xyz values for the desired displacement
'  5) backspace to undo; or any other key or click to accept

SETSELECTEDPOINTS

If Sys(1) < 1 Then
Message "No points selected. Try again."
  end
end If

input "Input desired point displacement in X direction ", dx
input "Input desired point displacement in Y direction ", dy
input "Input desired point displacement in Z direction ", dz

'input "Input desired X, Y, Z point displacements (separate by commas or spaces)", dx, dy, dz   'alternative sinlge-line input method

gosub ptmover

Print   " [Backspace] to undo;  any other key or click to accept"
anykey k

if k=8 then  ' if backspace key was pressed
dx=-dx
dy=-dy
dz=-dz
gosub ptmover
endif

end

ptmover:
>GroupPointsMove
{
  <Pointxyz [0, 0, 0]
  <PointRel [dx,dy,dz]
}
return



Copied from a discussion with Lar here: https://forum.designcad.com/index.php?topic=7167.msg51522#msg51522