Macro to replace a link in a sketch

Hello

 

I want to make a macro so that I don't have to click on "Replace" and then on "Validate" as soon as SW loses the link in a geometric relationship and I edit this relationship?

To start, you have to try to record a macro by learning and paste the code here if it doesn't work.