Repair External References went out of Context

Hello.

i have got an assembly with a part where in all the features the external references went out of context. Is it possible to use API to repair the context of the features? I am searching for the right method to do this. Can somebody help me to do this? I have got a license for the documentmanager Api so i can also use documentmanager.

SolidworksApi macros