Move1D, like Scale1d but for move

Hi guys, i’ve always wanted this command, so i made it. It’s like scale1d, but for move:

import rhinoscriptsyntax as rs

objs = rs.GetObjects("Select objects to Move1D", preselect=True)
if objs:
axis = rs.GetString("Axis", "X", \["X", "Y", "Z"\])
base = rs.GetPoint("Base point")
target = rs.GetPoint("Target/reference point")

if base and target:
    dx = target.X - base.X if axis == "X" else 0
    dy = target.Y - base.Y if axis == "Y" else 0
    dz = target.Z - base.Z if axis == "Z" else 0

    rs.MoveObjects(objs, (dx, dy, dz))

any chance you’d post a short screen capture of this in use?

Isn’t this basically exactly the same as clicking on one axis of the Gumball and punching in a number?

Exactly what I was thinking. But, it seems to me there are some folks who are very “anti-gumball”. So maybe that is what created the need?

Gumball is cool, but this is for the use case where you have a reference point on another object that you want to move the object in question to, but only in one dimension. As far as I know, gumball can only move by specified amounts or drags, not directly to a reference point.

Ah I see. That’s a great workaround.

“snappy dragging” … see in the gumball menu / click on the bunny-tail …

there is also _move and _copy both have a vertical option.

“move in x” will become move vertical to right (YZ-Plane) construction plane.
you can “macro” it by setting the cplane, calling _move _vertical _pause … and reset the cplane.

kind regards - tom

Another way to accomplish this is by using point filters.

A trick to using point filters is to set the degrees of freedom that should not change to the from point before picking the to point. For example, if the object(s) should only move along the X axis, the macro can be:

_Move _Pause _Pause _.yz @0,0

In this case, the _.yz @0,0 locks the translation in the YZ plane.