Attempting it with bones may be the simplest way to do it, or so I believe. (I’m new to blender, so can’t say for certain)
If you only plan to move the selected vertexes but not the cubes, then possibly follow this (Though you wont be able to edit/move the cubes after doing this, only those vertexs will move by the bone(s)):
- Create a bone where you wish it’s pivot point to be.
- Select the first cube, (shift + select) the bone & press (Ctrl + P) then select “With Empty Groups” so that the bone doesn’t control anything vertexs of the cube yet. (Repeat the same thing but now with the second cube.)
- Select one of the cubes, go to edit mode & select the vertices you want.
- Switch over to “Paint Weights” mode & press V if you do not see the selected vertixes highlighted.
- Go to “Object Data” on the far right menu screen (the Upside down triangle near the modifiers tab)
- Click the down-arrow for “Vertex groups” & select the bone on the list.
- Make sure the strength is set to 1, & then press “assign”
- You then repeat steps 3-7 for the other cube
And now when you move the bone, the vertexs that you selected of both cubes should move along when you move the bone. Though you can’t move the cube’s position like that, otherwise it would mess with the bone’s calculation.
In theory, if you could use two separate bones. Have boneA control purely those vertexs you want on both boxes, while boneB will be controlling all of the remaining vertexs on the cubes. Then you would constrained boneA’s movements to boneB’s movements. This way if you move boneB, both boxes will move completely including the specially selected vertexs since boneA will tag along, but if you only move boneA, then only the specially selected vertexs of both boxes will move. Sadly I’m barely learning how to use bones, so I can’t help much.