Attaching a rope (curve or mesh) to two other objects
What you can do is create a long plane, subdivide it, create a group, give it a Physics &gt; Cloth with the group as Pin Group:

Create your 2 objects, 2 cubes here (but it can be empties or bones), select a cube, shift select the plane, switch to Edit mode, select the same vertices as the pin group, press CtrlH &gt; Hook to Selected Object. You can hook to a vertex group of the object if needed. Do the same for the other cube. Put the Cloth modifier under the Hook modifiers:

Create your pipe object, hook it as well, give it a Surface Deform with the plane as Target, click on Bind. The Surface Deform modifier must be under the Hook modifiers:

Make the plane invisible, move the cubes: