attatch leads with commands

I'm trying to make an ODM gear datapack, and I want to attatch a lead between 2 armor stands so it looks like I am grappling on with actual rope. No matter how hard I look I cannot find anything about this in terms of tutorials, yet I am still able to find videos of people using it but they dont show the command
Continue to help post