# Quick way to move an object some distance from one external vertex to another external vertex?

I'm trying to move away from Autodesk Max, but I work with a lot of 2d plans, and one thing that I do very very often is to move an object ( or vertices of one object ) a distance x, taking as reference two vertices of another object ( or different objects ).

I know that I can do this in Blender using the 3d cursor, but there's three steps involved, and as I said I do this a few hundred times per day. Is there any way ( even if it's an addon ) to do it faster, without middle steps, like in this animation ( from 3dsmax ):

• Have a look at CAD transform, and see if you get on with it. Personally, I think it looks very promising, but could do with a bit more feedback in use, to be really polished. I agree, Blender's Snap could be slicker and quicker. – Robin Betts Nov 2 '20 at 11:00
• I was checking this video ( youtu.be/TWEoZghkalc ) and it seems that CAD Transform addon is exactly what I was looking for. I'll give it a try and see if it suits my work pipeline. – Fabman Nov 2 '20 at 11:51

A basic script for doing nearly the same (in object mode):

It is visually different as the object will move at first step then at the second one.

But the result is as expected, I think.

Use D key to use it. You can use Blender snapping options (i.e. snap to vertex) or not.

The principle is to use grab operator with invoke default from a modal operator:

import bpy
from mathutils import Vector

class GrabOffset(bpy.types.Operator):
"""Move an object by an offset"""
bl_idname = "object.grab_offset"
bl_label = "Grab with offset"

def modal(self, context, event):

#Left click
if event.type in {'LEFTMOUSE'}:
#Second left click?
if self.second_locations:
#Calculate delta and move objects
for obj, floc, sloc in zip(context.selected_objects, self.first_locations, self.second_locations):
obj.location = floc + obj.location - sloc
return {'FINISHED'}
#First left click
else:
#Keep locations
self.second_locations = [Vector(o.location) for o in context.selected_objects]
bpy.ops.transform.translate('INVOKE_DEFAULT')

#Aborting
if event.type in {'RIGHTMOUSE', 'ESC'}:
context.object.location = self.first_location
return {'CANCELLED'}

return {'RUNNING_MODAL'}

def invoke(self, context, event):
if context.selected_objects:
#Keep original locations
self.first_locations = [Vector(o.location) for o in context.selected_objects]
self.second_locations = None

#Invoke grab
bpy.ops.transform.translate('INVOKE_DEFAULT')

return {'RUNNING_MODAL'}
else:
self.report({'WARNING'}, "No active object, could not finish")
return {'CANCELLED'}

keymaps = []

def register():
bpy.utils.register_class(GrabOffset)
wm = bpy.context.window_manager
if kc:
kmi = km.keymap_items.new(GrabOffset.bl_idname, 'D', 'PRESS', shift=False)
keymaps.append((km, kmi))

def unregister():
for km, kmi in keymaps:
km.keymap_items.remove(kmi)
keymaps.clear()
bpy.utils.unregister_class(GrabOffset)

if __name__ == "__main__":
register()

# test call
#bpy.ops.object.modal_operator('INVOKE_DEFAULT')


• @RobinBetts, yes it is in the cook book. – lemon Nov 2 '20 at 14:41

In Blender the 'Snap With' > Center refers to the transform center in play at the time the snap is invoked. If Transform Pivot Point is set to '3D Cursor', then, with Snap set to With: 'Center' and To: 'Vertex', for an Object Mode snap, the steps are:

• Place the cursor at the source reference point. This could be done with ShiftS to the appropriate selected vertex in Edit mode, or, in Object mode, dragging and snapping the cursor itself, using the Cursor tool. If the Cursor tool's default shortcut: ShiftSpacebarSpacebar, is too awkward for frequent use, you can change it, and/or add it to your Quick Menu.
• Drag the object, hovering over the desired target point.

(A duplicate used, here, for illustration.)

• Thank you for your help, although this is what I was trying to avoid, having to use middle steps on the process. – Fabman Nov 2 '20 at 11:05

Maybe there's a cleaner way to do it but you could select all the objects, switch to Edit mode, enable the vertex snapping option (CtrlShiftTab to choose the vertex option), select these 5 vertices and duplicate:

• The problem with this solution as you said is that is not very clean and if the object has a lot of geometry is kind of slow to work this way. Maybe someone can find a quicker and cleaner way like the one on the gif. – Fabman Nov 2 '20 at 10:41
• Well... I think it's cunning :D – Robin Betts Nov 2 '20 at 10:52
• @Robin, I think you've got the right way to do it, I always come with the most trashy ah ah, that said Fabman didn't want to use the 3D cursor, I don't know if it's avoidable though – moonboots Nov 2 '20 at 10:53
• It's pretty cunning indeed. I don't mind using the 3d cursor. It's pretty useful for plenty of cases, but in this case a simple one step movement has to be done in three or four steps. :-( – Fabman Nov 2 '20 at 10:55
• I wouldn't mind if it were something that you do once a day, but in this case I have to use hundreds of times while I'm working with plans. – Fabman Nov 2 '20 at 10:56